Control M ????
kabir.patel@uk.andersen.com
kabir.patel@uk.andersen.com
Tue Feb 12 04:30:00 GMT 2002
Some time back I mentioned a problem I had with the ^M character (see below).
It so happens that I need to be able to replace every ^M in my resultant file
with a " " charachter.
GNU isn't happy with ^M. Is there a way to define ^M in another way?
Thanks in advance
Kabir Patel wrote:
> Line 9469 while((pChar=strchr(Uwel_notes1.str,'^M'))!=NULL)
> Line 9470 *(pChar) = *" ";
Embedding a character 13 into the source is horrible and, as it happens,
is causing this problem. (I also don't like the next line: there's no
point dereferencing a constant string just for a space! This isn't a
really bug, though - just style.)
Try:
while((pChar=strchr(Uwel_notes1.str,'\r'))!=NULL)
*(pChar) = ' ';
The problem was that the compiler was interpreting the ^M as a line
break and not a character constant. It was trying to compile:
while((pChar=strchr(Uwel_notes1.str,'
'))!=NULL)
and single-quoted constants may not cross line boundaries.
Rup.
*******************Internet Email Confidentiality Footer*******************
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery of
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by
reply email. Please advise immediately if you or your employer does not consent
to Internet email for messages of this kind. Opinions, conclusions and other
information in this message that do not relate to the official business of my
firm shall be understood as neither given nor endorsed by it.
More information about the Gcc-help
mailing list