CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Compatibility problem with const string on several lines

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
franckcl



Joined: 12 Sep 2003
Posts: 32
Location: France (Paris)

View user's profile Send private message

Compatibility problem with const string on several lines
PostPosted: Thu Jan 08, 2004 5:37 am     Reply with quote

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
PostPosted: Thu Jan 08, 2004 6:20 am     Reply with quote

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)

View user's profile Send private message

PostPosted: Thu Jan 08, 2004 7:20 am     Reply with quote

YES..... Good it is Ok now,

Thank you very much for your help "Ttelmah" !!

Franck
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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