• Advertisement

Archived

This topic is now archived and is closed to further replies.

Putting code on the next line

This topic is 5221 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do you parse code onto the next line for a macro: For example:

#define FUNC(n)  sprintf(n, "%d %d %d", //How would you do this

                         a, b, c);

Share this post


Link to post
Share on other sites
Advertisement
Use \ for multi line.



#define FUNC(n) sprintf(n, "%d %d %d", \
a, b, c);





-------
Andrew
PlaneShift - A MMORPG in development.


[edited by - acraig on November 5, 2003 5:46:28 PM]

Share this post


Link to post
Share on other sites
The above are correct, however there is one caveat: make sure that there is NOTHING between the backslash and the end of line. I once spent three days wondering why my code didn''t compile, until I found a space after the backslash in one of my macros.

Share this post


Link to post
Share on other sites

  • Advertisement