c 的頭文件標准格式


前記:

C語言的頭文件是嵌入式系統中常用的,也是很多人沒有注意的,但是寫的很差的,這里給出一個經典的模板,僅供參考。

 

正文:

 

經典的格式:

/**************************************
-----------------hello.h---------------------
product name:c code test
module name:hello
date:2020.12.04
auther:dylan 
file describe: hello process head file 
***************************************/

#ifndef  _HELLO_H_ 
#define _HELLO_H_

#ifdef __cplusplus // c++ include 
extern "C" { 
#endif       // include c++ file

//macro define
#define NAME 1

// variable 
char name;

//function include 
void printHello();

#ifdef __cpluscplus
}
#endif

#endif  //end _HELLO_H_

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM