View Single Post
  #4   Spotlight this post!  
Unread 23-12-2004, 15:51
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
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?