News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Switch's in C string line.

Started by zcoder, April 13, 2006, 11:44:46 PM

Previous topic - Next topic

zcoder

I am using VC6++ and have 4 warnings that bug me
I have searched everywhere I CAN think of but can't find
why I get this warning from this :
          lstrcat((LPSTR)&szDirPath,"\Release"); /* warning C4129: 'R' : unrecognized character escape sequence */

I want the backspash to be copied and it does but it warns me couse it's also some escape sequence.
how do I get rid of the warning?


Zcoder....

Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names

Mincho Georgiev

lstrcat((LPSTR)&szDirPath,"\\Release") - it will do the same job without the warning.

Synfire

To extend on what shaka_zulu said, C has something called escape characters. All escape characters start with a '\' and are followed by one or more characters which are translated by the C/C++ preprocessor. A few examples are \n which translates into a line feed (ASCII character 0x0D), \r which translates into a carriage return (ASCII character 0x0A), \x which is followed by a hex value to create an inline hex character (ie. "\x0A" is the same as "\n" and, in MASM, 0Ah). In your code you used \R which there is no such escape sequence. Btw, escape sequences are case sensitive so \R and \r are not the same thing.

Regards,
Bryant Keller

zcoder

thanks both of you shaka_zulu, Synfire
that fixed my warnings, I knew about the \n, \r, as those are used in php also.
I did not know about \x so that will come handy.

Thanks shaka_zulu, Synfire

Zcoder....
Back in 1979, My computer ran so fine.
And there was no such thing,
As a Microsoft Crashed Machine.
http://zcoder.110mb.com
http://www.dietzel.com/partner/idevaffiliate.php?id=345_6  Free Domain Names

Mincho Georgiev

Personally, i love the "\a" sequence - "Ring the Bell :)" ,because it's really nice sometimes for fast debugging purposes.