|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- #include "iostream.h"
- #include "string.h"
- struct student_info
- {
- string strName;
- int chinese;
- int math;
- int english;
- };
复制代码
我在main函数前面加上述,运行显示C:\Program Files\Microsoft Visual Studio\MyProjects\1\main.cpp(5) : error C2146: syntax error : missing ';' before identifier 'strName'
修改成如下就可以实现了- #include <iostream>
- #include <string>
- using namespace std;
- struct student_info
- {
- string strName;
- int chinese;
- int math;
- int english;
- };
复制代码 以前不是说加std不是相当于"*.h"
为什么第一个不行呢?????????????????
|
|