c语言咋错了?
#include<stdio.h>voidmain(){chara[11]={"i","","l","o","v","e","","y","o","u",\0};intb...
#include <stdio.h>
void main()
{char a[11]={"i"," ","l","o","v","e"," ","y","o","u",\0};
int b=0;
for(b=0,b<=10,b++)
{printf("%c",a[b]);
}
printf("\n");
}
D:\Microsoft Visual Studio\MyProjects\2233\233.cpp(5) : error C2143: syntax error : missing ';' before ')'
执行 cl.exe 时出错.
233.exe - 1 error(s), 0 warning(s) 展开
void main()
{char a[11]={"i"," ","l","o","v","e"," ","y","o","u",\0};
int b=0;
for(b=0,b<=10,b++)
{printf("%c",a[b]);
}
printf("\n");
}
D:\Microsoft Visual Studio\MyProjects\2233\233.cpp(5) : error C2143: syntax error : missing ';' before ')'
执行 cl.exe 时出错.
233.exe - 1 error(s), 0 warning(s) 展开
3个回答
展开全部
error C2143: syntax error : missing ';' before ')'
这个提示很明显呀,语法错误,在括号前缺少分号,for语法是这样的:
for(int i=0;i<100;i++)
printf("%d ",2*i+1);
这个提示很明显呀,语法错误,在括号前缺少分号,for语法是这样的:
for(int i=0;i<100;i++)
printf("%d ",2*i+1);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
for循环中写错了,应该是分号,而不是逗号。
for 循环的一般形式为:
for(表达式1; 表达式2; 表达式3){
语句块
}
for 循环的一般形式为:
for(表达式1; 表达式2; 表达式3){
语句块
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询