By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,851 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,851 IT Pros & Developers. It's quick & easy.

valid names for pre-processor defines

P: n/a
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.

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
brett wrote:
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?

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.