使用c++编写一个hello world简单程序

2025-10-21 14:57:31

1、首先可以到网上下载visual studio 2010,安装流程可以参考”百度经验如何安装visual studio 2010“,安装好后打开visual studio 2010

使用c++编写一个hello world简单程序

使用c++编写一个hello world简单程序

2、点击软件左上角“文件-新建-项目”,选择“win32-win32控制台应用程序”

使用c++编写一个hello world简单程序

3、或者直接点击起始页:新建项目,选择"Visual C++_win32_win32控制台应用程序"

使用c++编写一个hello world简单程序

使用c++编写一个hello world简单程序

4、输入一个本程序的名字,如hello-world,点击确定,点击”下一步“,初学者可以不用修改,直接点击”下一步“,然后点击”完成“

使用c++编写一个hello world简单程序

使用c++编写一个hello world简单程序

使用c++编写一个hello world简单程序

使用c++编写一个hello world简单程序

5、如果你学习的是C语言,代码行输入如下代码:

#include "stdafx.h"

#include <stdio.h>

int _tmain(int argc, _TCHAR* argv[])

{  printf("Hello world");

return 0;

}

使用c++编写一个hello world简单程序

6、如果你学习的是C++,代码行输入也可如下(注上面代码也是可以的,只是下面是C++通用输入法):

#include "stdafx.h"

#include <iostream>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])

{     cout<<"Hello world";

      return 0;

}

7、写好上面代码后,点击“生成-生成解决方案”,生成: 成功 1 个,失败 0 个,最新 0 个,跳过 0 个,即编写代码成功

使用c++编写一个hello world简单程序

使用c++编写一个hello world简单程序

8、然后点击“调试-开始执行(不调试)”,发现运行成功

使用c++编写一个hello world简单程序

使用c++编写一个hello world简单程序

9、如果一切正常,恭喜你迈入C++学习历程第一步

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:53
  • 阅读量:179
  • 阅读量:162
  • 阅读量:84
  • 阅读量:133
  • 猜你喜欢