GCC Multiple line string problem!
Hi!
How can I tell GCC that I'm using multiple lines in string, without getting syntax error?!: Code:
char buffer[] = "FIRST LINE\N Code:
char buffer[] = "FIRST LINE\NSECONDLINE\NTHIRDLINE"; |
Probably because the first one dosen't have a ";" after it and the second one does.
|
And after a bit of fiddling,
char buffer[] = "FIRST LINE\n" "SECOND LINE\n" "THIRD LINE\n"; |
That worked, thanks alot man!
|
Code:
|
IIRC, you can also append each line with a backslash, signaling the following CRLF to be taken litterally and added to the string, like so:
Code:
char buffer[] = "FIRST LINE\ |
All times are GMT -5. The time now is 10:43 PM. |