The first C++ program

来源:互联网 发布:unity3d在线编辑器 编辑:程序博客网 时间:2024/06/08 13:16

//Game Over//A first C++ program#include <iostream>int main(){std::cout<<"Game Over!"<<std::endl;return 0;}

一般游戏程序员选择C++的原因各种各样,下面列出其中一些原因:

·高速 ·灵活 ·良好的支持

而生成可执行文件包括以下爱的几个环节

编辑器->源代码->编译器->目标代码->链接器->可执行文件 

(为了让过程自动化,程序员通常回使用综合性的开发工具——集成开发环境(Integrated Development Environment,IDE)。一个典型的IDE集合了编辑器、编译器、链接器以及其它工具。Microsoft的Visual Studio Express 2013 for Windows Desktop是Windows下一款比较流行(且免费)的IDE。在www.visualstudio.com/dowloads/download-visual-studio-vs上可以找到关于此IDE的更多信息(且能下载到一份副本)。

编写第一个C++程序

程序员在学习新语言时,编写的第一个程序便是经典的Hello World程序,在屏幕上显示Hello World。Game Over程序打破了一个传统,显示的是Game Over!。

//Game Over 2.0//Demonstrates a using directive#include <iostream>using namespace std;int main(){cout<<"Game Over!"<<endl;return 0;} 


//Game Over 3.0//Demonstrates using declarations#include <iostream>using std::coutusing std::endlint main(){cout<<"Game Over!"<<endl;return 0;} 


                                             
0 0