我一直在寻找解决问题的方法,但发布的似乎不起作用。我正在尝试在 Visual Studio 2012 中运行以下内容。我以前使用 Eclipse 进行编程,并且正在适应新的 IDE。
class
IntSLLNode{
public:
int info;
IntSLLNode *next;
IntSLLNode(){
next = 0;
}
IntSLLNode (int el, IntSLLNode *ptr= 0) {
info = el;
next = ptr;
}
};
int main(){
#include <iostream>
using namespace std;
IntSLLNode *p = new IntSLLNode(18);
cout << *p;
return;
}
当我尝试运行它时,它在 cout 下给了我一个错误。我像往常一样包含了 iostream 和 std 命名空间。这不正确吗?任何人都可以帮助我让它工作,因为我非常喜欢 Visual Studio IDE 的外观并希望继续使用它。