不在 VS 上运行,但在开发C++上运行
Doesnt run on VS but runs on Dev C++
我一直在尝试在VS上运行这个基本程序。代码如下
#include<iostream>
using namespace std;
class student
{
public:
int id;
string name;
};
int main()
{
student s1, s2;
s1.id = 10;
s1.name = "ayudh";
s2.id = 20;
s2.name = "pooja";
cout << s1.id << endl ;
cout << s1.name << endl;
cout << s2.id << endl;
cout << s2.name << endl;
system("pause");
}
当我尝试运行它时,出现错误"没有运算符"<<"与此操作数匹配"。 有人可以帮助我解决问题吗?
你错过了
#include <string>
在文件的顶部。
相关文章:
- 运行同一解决方案的另一个项目的项目
- CMake-按正确顺序将项目与C运行时对象文件链接
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- 代码在main()中运行,但在函数中出现错误
- 不在 VS 上运行,但在开发C++上运行
- 开发时C++ .lib,运行应用程序时.dll
- 部署时,在开发计算机上运行应用不会运行
- 开发C++在运行大内存程序时崩溃
- 代码块使用Visual C++开发人员工具运行
- 开发C++应用程序以在嵌入式 Linux 安装程序上运行
- QSerialPort 在开发环境之外运行时崩溃
- 在没有VS11 Beta的计算机上运行在VS11 Beta上开发的应用程序
- dev 我刚刚开始使用 DEV C++编译器。一些在涡轮编译器中运行良好的程序在开发编译器中没有运行。怎么办?
- 为什么安装vcredist_x86.exe不能修复 SideBySide 错误,当我在一台机器上开发 EXE 并在另一台机器上运行它时?
- 让它的C++开发应用程序在64位模式下运行有什么大的好处吗
- 当我在开发C++中编译和运行时程序崩溃
- 从vi运行各种c或cpp开发任务"就像在不退出vi的情况下运行cpp程序一样。
- TTS C++程序只能在开发中的PC机上运行
- 当我运行此代码时,开发人员C++不断崩溃.我不明白为什么
- 存档没有索引;运行 ranlib 以在开发C++中添加一个