Accelerated C++学习笔记1—<开始学习C++>

第0章 开始学习C++

1、每次学习一个新的语言,大家都是从Hello, world!开始
// lesson0_1.cpp : 定义控制台应用程序的入口点。
//功能:编译并运行Hello,world
//时间:2014.5.7


#include "stdafx.h"
#include "iostream"
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
	std::cout<< "Hello,world" <<std::endl;
	return 0;
}

实验结果:
Accelerated C++学习笔记1—<开始学习C++>

2、编写一个程序,编写一个程序,使它运行时输出 This (*) is a quote, and this (\) is a blacklash.

// lesson0_2.cpp : 定义控制台应用程序的入口点。
//功能:编写一个程序,使它运行时输出 This (*) is a quote, and this (\) is a blacklash.
//时间:2014.5.7

#include "stdafx.h"
#include "iostream"
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
	std::cout<< "This (*) is a quote, and this (\\) is a blacklash."<<std::endl;
	return 0;
}

实验结果:

Accelerated C++学习笔记1—<开始学习C++>
注意事项:这里的 \ 编代码时候要写成\\ 否则显示的只有空格。
3、一个最短的有效程序
int main ()
{
}

4、重写Hello,world! 让程序中每一个允许出现空白符的地方都换行

// lesson0_3.cpp : 定义控制台应用程序的入口点。
//功能:重写Hello,world! 让程序中每一个允许出现空白符的地方都换行
//时间:2014.5.7

#include "stdafx.h"
#include "iostream"
using namespace std;


int _tmain(int argc, _TCHAR* argv[])
{
	std
	::
	cout	
	<<
	"Hello,World!"
	<<
	std
	::
	endl
	;
	return 
	0
	;
}

Accelerated C++学习笔记1—<开始学习C++>

总结:本节主要就是让了解下怎么编写C++的第一个程序Hello,world!从来来了解如何建立C++的一个环境。
我的软件平台是Microsoft Visual Studio 2008破解版。如果大家需要软件资源可以找我要。


Accelerated C++学习笔记1—<开始学习C++>,布布扣,bubuko.com

Accelerated C++学习笔记1—<开始学习C++>

上一篇:JavaScript发展史,与JScript区别,引入方式,数据类型,命名规范,命名推荐,解决命名冲突


下一篇:【Python】Python对文件夹的操作