#include \"stdafx.h\"
#include <stdio.h>
void count(void);
int *yen=0;
int _tmain(int argc, _TCHAR* argv[])
{
count();
count();
printf(\"%d\",*yen);
return 0;
}
void count(void)
{
static int c;
c++;
yen=&c;
printf(\"%d\\n\",c);
}
이렇게 하니까 되는거 같던데 전역변수로 쓸수있는건가요?
메모리를 들쑤시고 다니면 못할 게 없습니다.
근데 보통 함수 안에 멀쩡히 숨겨놓은 변수를 외부에서 만져서 좋을 일은 별로 없으니 실제로는 하지 마시길
스태틱 멍청아!
아 감사요 ㅋ 결국 포인터 짱이네요