在C++开发时,项目较大时,通常采用多文件编写,并以工程的形式进行代码管理
1、C++多文件编程格式
1、.h 头文件编写格式
#ifndef __PERSON_H
#define __PERSON_H
#include <iostream>
using namespace std;
class Person
{
成员变量的定义和函数的声明
};
#endif
2、.cpp 编写格式
#include "Person.h"
成员函数的实现
Person::Person()
{
}..............