|
Re: Using macros with operator symbols
How about this...
#define incr(var,n) ((var) += (n))
Then your code would look like...
incr(x,10);
incr(y,5);
This allows a single macro to increment whatever variable is passed to it.
From your original question, though, you seem to be wanting to hide the BAR variable from the user. Is there a reason for that?
|