Skip to content

05-变量声明 ​

cpp当中: 可以在for循环的开头直接定义变量(这在c语言中通常不可以)

cpp


for(int i = 0 ; i <= 5 ; i++)
{
	printf(%d,i);
}

在c当中需要这样:

c

int i;

for(i = 0 ; i <= 5 ; i++)
{
	printf(%d,i);
}
最近更新