|
|
View previous topic :: View next topic |
Author |
Message |
franckcl
Joined: 12 Sep 2003 Posts: 32 Location: France (Paris)
|
Compatibility problem with const string on several lines |
Posted: Thu Jan 08, 2004 5:37 am |
|
|
Hi,
CCS add a space character and the LF (0x0A) character at the end of each following lines :
const char MyString[]={"\
First,\
Second,\
Third"};
After compilation the string becomes :
\x20\x0AFirst,\x20\x0ASecond,\x20\x0AThird
I think that is not ansi compatible.
I have compile it with Borland C compiler and the result is :
First,Second,Third
Is there a solution to remove the 0x20 and 0x0A characters ?
This is a real problem for me !
Thank you
Franck |
|
|
Ttelmah Guest
|
Re: Compatibility problem with const string on several lines |
Posted: Thu Jan 08, 2004 6:20 am |
|
|
franckcl wrote: | Hi,
CCS add a space character and the LF (0x0A) character at the end of each following lines :
const char MyString[]={"\
First,\
Second,\
Third"};
After compilation the string becomes :
\x20\x0AFirst,\x20\x0ASecond,\x20\x0AThird
I think that is not ansi compatible.
I have compile it with Borland C compiler and the result is :
First,Second,Third
Is there a solution to remove the 0x20 and 0x0A characters ?
This is a real problem for me !
Thank you
Franck |
You will get the result you want with:
const char MyString[]={\
"First,"\
"Second,"\
"Third"};
Best Wishes |
|
|
franckcl
Joined: 12 Sep 2003 Posts: 32 Location: France (Paris)
|
|
Posted: Thu Jan 08, 2004 7:20 am |
|
|
YES..... Good it is Ok now,
Thank you very much for your help "Ttelmah" !!
Franck |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|