View Single Post
  #14   Spotlight this post!  
Unread 08-02-2009, 18:58
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Understanding the Source code

the ## is the preprocessor concat symbol

so in S(label, offset, message) const int wpi_v_##label = offset; const char *wpi_s_##label = message ;


if you say S(MyLabel, 1,"Message of mine")
it will replace the vars so it looks like this


const int wpi_v_MyLabel = 1;
const char *wpi_s_MyLabel = "Message of mine";
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote