Beginner's question

W

Wong

Hi gurus,

This macro does not look like a common one. Is this a function ?

#define Uint16(value) Uint8(value) , Uint8(value << 1)

Thanks in advance.
 
D

dandelion

Wong said:
Hi gurus,

This macro does not look like a common one. Is this a function ?

#define Uint16(value) Uint8(value) , Uint8(value << 1)

Nope. It's a macro. Anything which is '#defined' is.
 
R

Richard Bos

This macro does not look like a common one. Is this a function ?

#define Uint16(value) Uint8(value) , Uint8(value << 1)

No, it's a function-like macro. It takes one parameter, and expands to
the text behind it with "value" replaced by that parameter. For example:

a=Uint16(24);

is expanded to

a=Uint8(24) , Uint8(24 << 1);

in which both Uint8's are probably macros as well, so they would now be
expanded, too.

This does not look like a very useful macro to me, but it is a macro all
the same.

Richard
 
F

Flash Gordon

dandelion said:
Nope. It's a macro. Anything which is '#defined' is.

It looks to me like it is also probably wrong, as well as being bad
style for not being spelled in upper case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top