重新打开该项目,它将恢复状态的IDE我们离开的地方。 当我们选择来编译我们的程序,项目文件进行编译和链接告诉编译器和链接器。 这是值得注意的一个IDE的项目文件将无法在其他IDE。
其次,有各种不同的项目。 当你创建一个新的项目,你将不得不选择一个项目类型。 在本教程中,我们将创建的所有项目将控制台项目。 意味着我们要创建程序,可从DOS或者Linux的命令行运行一个控制台项目。 默认情况下,控制台应用程序没有图形用户界面(GUI)和被编译成独立的可执行文件。 这是完美的学习C + +,因为它保持到最低限度的复杂性。
传统上,第一个程序的程序员写一个新的语言,是臭名昭著的Hello World程序 ,我们不会剥夺你这方面的经验! 以后你会感谢我们。 也许吧。
例子包含代码的快速笔记
从这一课,你会看到许多的C + +代码的例子。 这些例子大多会是这个样子:
1
2
3
4
5
6
7
8
#include <iostream>
int main()
{
using namespace std;
cout << "Hello world!" << endl;
return 0;
}
If you select the code from these examples with your mouse and then copy/past it into your compiler, you will also get the line numbers, which you will have to strip out manually. Instead, click the “copy to clipboard” link at the top of the example. This will copy the code to your clipboard without the line numbers, which you can then paste into your compiler without any editing required.
Visual Studio 2005 Express
To create a new project in Visual Studio 2005 Express, go to the File menu, and select New -> Project. A dialog box will pop up that looks like this: