如何创建在C ++中我自己的头文件? [英] How to create my own header file in c++?

查看:147
本文介绍了如何创建在C ++中我自己的头文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能创建自己的一个新的头文件?谁能帮我如何在C ++中我自己的头文件用一个例子?

Is it possible to create a new header file of my own? Can anyone help me how to create my own header file in c++ with an example ?

推荐答案

是的,当然可以,但在这之前,你需要了解什么头文件,以及如何正确地使用它们。

Yes, of course you can, but before that you need to learn what header files are and how you can use them properly.

文件:yourname.h

file: yourname.h

#ifndef YOUR_NAME_INCLUDE
#define YOUR_NAME_INCLUDE

/* Your function statement here */    

yourname.cpp

yourname.cpp

#include <iostream.h>
#include "yourname.h"

/* Your function definition here */

的main.cpp

main.cpp

#include <iostream.h>
#include "yourname.h"

/* Your function calling here */

要了解更多有关的头文件,包括报表,请点击下面的链接。

To learn more about header files and include statements, click the link below.

头教程

这篇关于如何创建在C ++中我自己的头文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆