天天看点

C++:第一个程序

C++:第一个程序

// iostream: 标准输入输出流 i - input 输入  o - output 输出 stream 流 相当于stdio.h
// 注意:C++ 标准库名不须带后缀.h。
#include <iostream>
using namespace std; // 使用标准命名空间。std是命名空间,包含cin、cout。

int main()
{
	// cout 标准输出流对象
	// c语言中,<<表示二进制左移运算符,C++中在cout后用于拼接输出内容
	// endl - end line 刷新缓冲区,并且换行。
	cout<<"Hello world"<<endl;
	return 0;
}
           

继续阅读