C++遵循先定义,后使用的原则.就拿函数的使用来举例吧. 我看过有些人喜欢这样写函数. #include<iostream> using namespace std; int add(int x, int y) //A { return x + y; } int main() { , ); //B system("pause"); ; } 但我更偏向下面这种. #include<iostream> using namespace std; int add(int
一.<Google C++ 编程风格指南>里的观点 公司在推行编码规范,领导提议基本上使用<Google C++ 编程风格指南>.其中<Google C++ 编程风格指南>对于头文件的包含顺序是这样的: Names and Order of Includes link ▽Use standard order for readability and to avoid hidden dependencies:C library, C++ library, other lib