暗黙の初期化
明解C言語 入門編 > 6. 関数 >
暗黙の初期化
C
#include <stdio.h>int fx = 0;
void func(void)
{
static int sx;
int ax;
printf("%3d%3d%3d\n", ax, sx, fx);
}int main(int argc, char* argv[])
{
func();
}
実行結果
R:\>lesson054\project1.exe
8802932 0 0
明解C言語 入門編 > 6. 関数 >
#include <stdio.h>int fx = 0;
void func(void)
{
static int sx;
int ax;
printf("%3d%3d%3d\n", ax, sx, fx);
}int main(int argc, char* argv[])
{
func();
}
R:\>lesson054\project1.exe
8802932 0 0