Skip to main content
GameDev.net gamedev.net
🔒 Locked

Strings problem in GCC

Started by Raduprv May 29, 2003 at 2:02 AM 2 replies 500+ views
Original Post
Raduprv
Raduprv
I have a problem with the way GCC handles strings. For example, if I have this instruction: my_strcp(dest,"This is a string which will be splited on two lines. Now we are on the second line"); GCC will add a \n after "lines." So, my string will have a new line it it. Which is not nice, especially when I have long strings and I want to press enter in the middle, for readability purposes. Is there any way to solve this problem, and not have \n in the string except if I specifically request it? Height Map Editor | Eternal Lands | Fast User Directory
Beer Hunter
Beer Hunter
I''m pretty sure the solution is:

my_strcp(dest,"This is a string which will be splited on two lines. "
"Now we are on the second line");
George2
George2
"this is a very long string \
you can split it up with a slash (slash needs to be followed by a newline)"
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.