•可以选用g++编译器
•源文件扩展名可以是.cpp .cc .C .cxx等
•不再使用c中的头文件
如果要用,可以在c头文件名前加c
• #include <cxxxx>
•不再使用scanf/printf而是cin/cout
•标准的C++头文件不再以.h结尾
注意哦 <iostream> 输入输出
C++中的include C++里面自己的内容的时候使用<> 不加.h
如果include我们自己写的类的时候 ,使用双引号 "" 加.h
</pre><pre name="code" class="cpp">
</pre><pre name="code" class="cpp">
//
// main.cpp
// HYR_hello
//
// Created by 06 on 15/1/8.
// Copyright (c) 2015年 黄永锐. All rights reserved.
//
#include <iostream>
//#include <stdio.h>
//C中的头文件 在C++里面已经重写过 在头文件前加C去掉.h
#include <cstdio>
int main(int argc, const char * argv[])
{
//std:: 命名空间(名字空间)
std::cout << "Hello, World!\n";
//::域运算符
std::cout << "请输入一个整数:" << std::endl;
//声明变量
int x;
//输入
std::cin >> x;
//输出
std::cout << "您输入的是 x = " << x << std::endl;
return 0;
}