What does the following preprocessor directive do?

C

contactsakthi

Hi All,

What does the following pre-processor directive do?

#define X {{0xff, 0xffff}}

Thanks in advance
 
P

Philip Potter

Hi All,

What does the following pre-processor directive do?

#define X {{0xff, 0xffff}}

Thanks in advance

From this line forth until the end of translation unit or '#undef X',
every occurence of the indentifier X will be replaced with
{{0xff, 0xffff}}.

In other words, anywhere where you could have written {{0xff, 0xffff}}
you may now write X instead and it will have exactly the same effect.

For further reading, please refer to the pre-processor section of your C
textbook.
 
W

Walter Roberson

From this line forth until the end of translation unit or '#undef X',
every occurence of the indentifier X will be replaced with
{{0xff, 0xffff}}.
In other words, anywhere where you could have written {{0xff, 0xffff}}
you may now write X instead and it will have exactly the same effect.

Except in string or character literals, of course.
 

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

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top