valid names for pre-processor defines

B

brett

I dont have the ANSI spec in front of me, can someone please tell the
definition of a valid name for C preprocessor defines?

ie. is it ONLY alphanumerical charactaers and the underscore symbol, or can
I use "-" and other symbols as well?

I'm trying to figure out if a new compiler is behaving itself or not!

Thanks,
Brett.
 
R

Rolf Magnus

brett said:
I dont have the ANSI spec in front of me, can someone please tell the
definition of a valid name for C preprocessor defines?

ie. is it ONLY alphanumerical charactaers and the underscore symbol, or
can I use "-" and other symbols as well?

The rules are the same as for any other identifier: It must start with a
letter or an underscore, followed by letters, underscores and/or numbers.
However, it must not start with an underscore followed by an uppercase
letter or contain two consecutive underscores, since such identifiers are
reserved.
I'm trying to figure out if a new compiler is behaving itself or not!

What's it doing?
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top