包括带有全局变量的头文件 [英] Including header file with global variable

查看:104
本文介绍了包括带有全局变量的头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要包含一个包含一些全局变量的头文件(不是我的,所以我不能改变它)。

I need to include a header file that contains some global variables (not mine so I cannot change it).

如何做,除了一种情况,包含的文件被认为是extern。

How do I do this so that the variables within the included file are considered 'extern' in all but one case?

推荐答案

复制标题,并自己添加extern。

You cannot. Copy the header and add extern yourself.

这篇关于包括带有全局变量的头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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