|
-
May 11th, 2006, 09:40 PM
#1
#define a string in multiple lines?
I hope there's an easy way to do this. I have a long string spanning multiple lines. I just want to write that to a file in a function. I'm wondering if there is a way to make a #define that lets the string span multiple lines?
Or is there a better approach to this? There's a whole bunch of invalid characters in it too and it's a pain to remove them one by one.
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
May 11th, 2006, 10:46 PM
#2
Re: #define a string in multiple lines?
If your line ends with an underscore, it will be carried over to the next line. I'm not sure if this will work inside a string constant, but it's worth a shot!
Code:
#define foo() this is a; _
multiple line; _
definition;
Edit: wrong character. Use the backslash (\) instead.
Last edited by sunburnt; May 12th, 2006 at 11:47 AM.
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
-
May 11th, 2006, 11:41 PM
#3
Re: #define a string in multiple lines?
aah my friend just showed me to use \ at the end
what's the difference between usign that and _
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
May 12th, 2006, 10:53 AM
#4
Re: #define a string in multiple lines?
The _ is the VB way, and sunburnt either made a typo or confused the two. It won't work in C++, at least not standard C++.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 12th, 2006, 11:46 AM
#5
Re: #define a string in multiple lines?
 Originally Posted by CornedBee
The _ is the VB way, and sunburnt either made a typo or confused the two. It won't work in C++, at least not standard C++.
Whoops, you're right -- teaches me to post late at night I meant to use the backslash character!
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
-
May 12th, 2006, 01:49 PM
#6
Re: #define a string in multiple lines?
hehe
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|