[英]Can't initialize variables in for loop in C in VSCODE
I think something wrong with my VSCode, since i can't initialize varibles in loops in C For instance:我认为我的 VSCode 有问题,因为我无法在 C 的循环中初始化变量 例如:
#include <stdio.h>
int main(){
for(int i = 0; i < 5; i++){
printf("%i", i);
}
}
It gives compile error How can I fix it?它给出了编译错误我该如何修复它? Thanks in advance提前致谢
either declare i prior to the for loop or compile with "-std=c99"在 for 循环之前声明 i 或使用“-std=c99”编译
#include <stdio.h>
int main(){
int i = 0;
for(i = 0; i < 5; i++){
printf("%i", i);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.