从宏值获取宏名称 [英] to get macro name from macro value

查看:80
本文介绍了从宏值获取宏名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何从宏值中获取宏名称

这样在头文件中



#define a 100

#define b 200

现在源文件将是

用户给出100

然后值是输出为

,用户给出200

然后输出值为b

是否可能

谢谢提前

问候

sounak

How could we get a macro name from a macro value
such that
in a header file
#define a 100
#define b 200
now the source file will be such that
the user gives 100
then the value is outputted as a
the user gives 200
then the value is outputted as b
is it possible
thanks in advance
regards
sounak

推荐答案

Le 22-11- 2005年,sounak< so ***** @ gmail.com> écrit*:
Le 22-11-2005, sounak <so*****@gmail.com> a écrit*:
我们如何从宏值中获取宏名称
这样在头文件中
#define a 100
#定义b 200
现在源文件将是这样的,用户给出100
然后将值输出为
用户给出200
然后值为输出为b

是否可能
How could we get a macro name from a macro value
such that
in a header file
#define a 100
#define b 200
now the source file will be such that
the user gives 100
then the value is outputted as a
the user gives 200
then the value is outputted as b

is it possible




您真正需要什么?什么是

结果:

#define a 100

#define b 200

#define c ((b) - (a))

#define d(a<<< 1)

#define e 100


Marc Boyer



What did you really need ? What would be the
result with:
#define a 100
#define b 200
#define c ((b)-(a))
#define d (a<<1)
#define e 100

Marc Boyer


Marc Boyer< Ma ******** @ enseeiht.yahoo.fr.invalid>写道:
Marc Boyer <Ma********@enseeiht.yahoo.fr.invalid> wrote:
Le 22-11-2005,sounak< so ***** @ gmail.com> écrit*:
Le 22-11-2005, sounak <so*****@gmail.com> a écrit*:
我们如何从宏值中获取宏名称
这样在头文件中
#define a 100
#定义b 200
现在源文件将是这样的,用户给出100
然后将值输出为
用户给出200
然后值为输出为b

是否可能
How could we get a macro name from a macro value
such that
in a header file
#define a 100
#define b 200
now the source file will be such that
the user gives 100
then the value is outputted as a
the user gives 200
then the value is outputted as b

is it possible



你真正需要什么?结果如何:
#define a 100
#define b 200
#define c((b) - (a))
#define d (a<< 1)
#define e 100



What did you really need ? What would be the
result with:
#define a 100
#define b 200
#define c ((b)-(a))
#define d (a<<1)
#define e 100




....并且用户输入350?


Richard



....and the user enters 350?

Richard


我只是想得到指定宏值的宏名称

正好与宏相反

#define a 100

我们指定100我们得到的输出为

sounak

i just wanted to get the macro name of the specified macro value
just the opposite what macro does
#define a 100
we specify 100 we get output as a
sounak


这篇关于从宏值获取宏名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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