使用string定義類時(shí)出現(xiàn)問(wèn)題
error C2146: syntax error : missing ';' before identifier 'name'為什么會(huì)這樣? #include "string.h" class student { private : int num; string name; float chinese,math,english; public : student (); void setscore(float ,float ,float); ~student(); void setname(string); void showscore(); };
2016-11-30
頭文件應(yīng)該是#include <string>