C:\Dev-Cpp\Templates\Date2.0.cpp In function `int main()': 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"...
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 gave this one twice) ...
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> ...
1)case '@': ClearStack(S); break; 清空栈后,想再不初始化就再使用?top指针其实编程空指针了。2)什么情况下用变量的使用问题,typedef struct{。。。}SqStack,*S;中的*S,InitStack(S);把S当做全局指针?基础要加强。3)代码修正如下,可以正确运行。include<stdlib.h> include<stdio.h> ...
[k],word.c_str()); k++; }for(inti=0; i<2000;i++) { Dictionary::translate(out_s,temp_eng_words[i]);// ERROR RELATES TO THIS LINE - cannot call member function like this. error - expected primary expression// before ] if written out_s[].} } Translator::Translator(constchar...
struct student { int num;char name[30]; //人名不可能是单字符!char sex[5]; //性别,你后面用的%s读、写,就要定义成字符串 float math;float english;float politics;};
In file included from Main.cpp:4: CPPString.cpp: In constructor ‘CPPString::CPPString(unsigned char*)’: CPPString.cpp:6: error: expected primary-expression before ‘unsigned’ make: *** [main] Error 1 The compiler finds the error at what is pictured above as line 3. ...
is_valid()) ext_str_tab_s1 = (*ext_str_tab_v)[i]; return Hash<const char*>::operator()(ext_str_tab_s1); } Error:- netlist_back_1.C: In member function 'int Netlist::ExtStrHash::operator()(NlString) const': netlist_back_1.C:24: error: expected primary-expression before ...
由于你的“+-*/”,是一个裸的符号,没有被单引号''给包起来,被C++编译器当成了一个实际的加减乘除的,表达式。纠错很简单,就把对应的加减乘除号,用单引号括起来:if((c==+))修改成:if(c=='+')其他类似的地方相同处理就可以。没有查看你程序的其他问题。
得看你报这个错的那行代码,才能知道怎么改,单单是这么一个错误信息,只能知道你的那行代码缺基本表达式,但是无法判断出来如何修正。