【发布时间】:2011-09-26 15:10:11
【问题描述】:
我已经安装了 Visual Studio Express 2010 C++。但是,当尝试按照初学者书籍制作 hello world 程序时,Visual Studio 会在其中打开一个项目:
#include "stdafx.h"
using namespace System;
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
return 0;
}
问题是,这与我刚开始阅读的书中的 c++ 完全不同(C++ 没有恐惧)。事实上,如果我输入 'cout',即使在进入 using namespace std 之后,也找不到 cout。
这是书籍示例:
#include "stdafx.h"
#include <iostream>
using namespace std;
int main() {
cout << "Never fear, C++ is here!";
return 0;
}
我在这里错过了什么吗?
【问题讨论】:
标签: c++ visual-studio-2010 visual-c++