Original Post
#define A 10
#define B 200 / A
B should be replaced by the constant 20, right? Just trying to make sure..
Kings of Chaos
[edited by - n0ob on August 28, 2003 3:51:37 PM]
quote:
Original post by n0ob
#define A 10
#define B 200 / A
B should be replaced by the constant 20, right? Just trying to make sure..
Kings of Chaos
quote:
Original post by UberGeek
- Defining a simple letter is a bad idea. Why? Say I have a function called DoAThing. When the preprocessor comes around, it sees that A and replaces it with your number. So you would be trying to call Do10Thing, which would seem to result in a very odd error.
quote:
Original post by Anonymous Poster
If you were any more wrong, the world would explode.
quote:
Original post by LessBread
To explain the issue rather than berate, the DoAThing example is wrong because macros have a different namespace than functions.
quote:
Original post by Promit
Can you elaborate a bit? The reason the ''A'' in DoAThing won''t be replaced is because defines only replace whole tokens, not everything they find...but I''m still curious what it is you are talking about...
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more