本文介绍了您可以在#define宏名称中使用a.b表示法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用Visual Studio 2008或2010声明一个定义,如下所示:
I want to declare a define, using Visual Studio 2008 or 2010, like that:
#define a.b c.d我得到以下错误:
错误C2008:.":宏定义中出乎意料
error C2008: '.' : unexpected in macro definition
我看到可以创建这样的定义:
I see that I am allowed to create a define like this:
#define a c.d宏名称中是否应该允许使用 a.b 表示法?
Is the a.b notation supposed to be allowed in the macro name?
推荐答案宏与标识符具有相同的命名规则集.实际上,宏名称是标识符.
Macros has same set of rules for naming, as do identifiers. In fact, macro-names are identifiers.
所以
- 它们不能包含点.
- 它们可以,只能包含字母,数字和下划线.没有其他的.但是,它们不能 以数字开头.
- They cannot contain dot.
- They can consist of only alphabet, digits, and underscore. Nothing else. They cannot start with a digit, however.
更多推荐
您可以在#define宏名称中使用a.b表示法吗?
发布评论