Jef*_*jit 29
是的,当然可以,但在此之前,您需要了解哪些头文件以及如何正确使用它们.
file:yourname.h
#ifndef YOUR_NAME_INCLUDE
#define YOUR_NAME_INCLUDE
/* Your function statement here */
#endif
Run Code Online (Sandbox Code Playgroud)
yourname.cpp
#include <iostream.h>
#include "yourname.h"
/* Your function definition here */
Run Code Online (Sandbox Code Playgroud)
main.cpp中
#include <iostream.h>
#include "yourname.h"
/* Your function calling here */
Run Code Online (Sandbox Code Playgroud)
要了解有关头文件和包含语句的更多信息,请单击下面的链接.
是的,您可以创建自己的头文件。
文件:myheader.h
#ifndef MYHEADER
#define MYHEADER
......
#endif
Run Code Online (Sandbox Code Playgroud)
文件:myclass.cpp
#include <iostream.h>
#include "myheader.h"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
92285 次 |
最近记录: |