1,075,642 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by ChaseRLewis which have been Voted Down

Guess nothing as convenient as lua's --[[ --]] operators. Never really had a need for such long strings so never really looked into it.

ChaseRLewis
Junior Poster in Training
78 posts since Nov 2009
Reputation Points: 7
Solved Threads: 2
Skill Endorsements: 0

I'm starting to write more intricate code that does some dynamic compilation through Lua and OpenGL. However, my code is starting to get kinda messy because I have many const char* strings and strings in sections of my code so they can be parsed together properly depending on specific conditions. The only method I know for structuring strings across multiple lines is:

const char* foo = "1\n\
2\n\
3";

prints --
1
2
3

Is there a better way as this looks messy? Maybe some method of using \b*number.

Visual Studio automatically does this but unfortunately it puts all the spaces on the line leading too it.

const char* foo = "1\n\
                   2\n\
                   3";
prints --
1
                   2
                   3

I don't really want to do \b\b\b\b\b\b\b\b\b\b\b\b\b\b or something silly or even count the backspaces unless I have to. Any ideas?

ChaseRLewis
Junior Poster in Training
78 posts since Nov 2009
Reputation Points: 7
Solved Threads: 2
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.0369 seconds using 2.46MB