1.在头文件中,创建名字为 函数名.h 的文件
#include <iostream>
using namespace std;
函数的声明
2.在源文件中,创建名字为 函数名.cpp 的文件
#include "函数名.h''
函数的定义
3.在源文件中,创建主函数所在的主文件
//include <iostream>
//using namespace std;
#include "函数名.h"
使用函数
1.在头文件中,创建名字为 函数名.h 的文件
#include <iostream>
using namespace std;
函数的声明
2.在源文件中,创建名字为 函数名.cpp 的文件
#include "函数名.h''
函数的定义
3.在源文件中,创建主函数所在的主文件
//include <iostream>
//using namespace std;
#include "函数名.h"
使用函数