I am new to learning C and I'm having a hard time figuring out the syntax. I keep getting [error] expected expression before char in my compiler and I was wondering if some one could explain it to me. Here's my code: #include<stdio.h>voidconvert_weight(intx,chara[],int* y,char...
0 Error: Expected expression before char 1 Expected expression before ‘char’ in C 0 C: I keep getting errors that say error: expected expression 1 "expected expression before char" inside function 1 Expected expression before char in C 0 Error: Expected ')' before 'char' error in...
楼主的问题答案是数组初始化(即赋值)错误了。应该在定义数组的时候用{}把数组整体初始化;如果定义的时候不整体初始化,在定义数组之后再想初始化的话,只能单个元素初始化,而不能整体初始化了。而且楼主的程序也有问题,s[10]里面有10个元素,从s[0]到s[9],没有s[10],如果运行的话,for里面...
是的,您for那一行是错误的,正确的写法应该是 您错就错在将分号改成了逗号,并且您还多加了两个分号。分别加在了末尾循环体和右括号后面。下面具体为您介绍一下for语句的用法 1.语句最简形式为:for( ; ; )2.一般形式为:for(单次表达式;条件表达式;末尾循环体){ 中间循环体;} 其中,表示...
18 C:\Dev-Cpp\Templates\Date2.0.cpp expected primary-expression before "char" 18 C:\Dev-Cpp\Templates\Date2.0.cpp expected `;' before "char" 23 C:\Dev-Cpp\Templates\Date2.0.cpp expected primary-expression before "char" 23 C:\Dev-Cpp\Templates\Date2.0.cpp expected `;' before "char"...
23 C:\Dev-Cpp\Templates\Date2.0.cpp expected primary-expression before "char" 23 C:\Dev-Cpp\Templates\Date2.0.cpp expected `;' before "char" Part of my code // This program demonstrates the Date class. #include <iostream> #include <cctype> ...
line 15: expected primary-expression before "char" line 15: expected ';' before "char" line 23: expected primary-expression before "continue" line 23: expected ')' before "continue" line 23: expected ';' before '==' token line 23: expected primary-expression before "continue" (yes, it...
得看你报这个错的那行代码,才能知道怎么改,单单是这么一个错误信息,只能知道你的那行代码缺基本表达式,但是无法判断出来如何修正。
该行改为 input(pat);把pat的定义移到前面去 int select;struct patient pat;fflush(stdin);
子函数里 for(i=1;i<=num;i++){ for(j=1;j<=num-i;j++){ for(j=1;j<=2*i-1;j++)} } 这段 语法不通 for后面要接{} 如果执行仅一句可不加 但你这个没有可执行的啊?是没编完吧 建议:for(i=1;i<=num;i++){ for(j=1;j<=num-i;j++){ for(j=1;j<=2*i-1;...