---
title: ".h文件引用的一些规范"
author: "hellsing42"
date: "2012-07-04T13:57:40Z"
tags: []
categories: ["移动开发"]
slug: "h"
draft: false
lastmod: "2012-07-04T13:57:40Z"
id: 1576428
url: "https://hellsing42.iteye.com/blog/1576428"
---

对于.h的引用要使用#ifndef #define #endif去防止.h文件多次被引用。
例如
a_test.h:


```c
#ifndef a_test_h
#define a_test_h

h内容
...
...
...
...

#endif
```


这种格式，h文件实际在编译时会把.h文件的内容复制到相应的c文件中！