0
我一直在試圖在VS上運行這個基本程序。代碼如下不在VS上運行,但在Dev C++上運行
#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");
}
當我嘗試運行它,我得到一個錯誤「不操作」 < <「匹配這個操作數」。 有人可以幫我解決這個問題嗎?