From: THOMAS C. <VCECMP.CHEFTH@MEMO.VOLVO.SE> - 2000-11-28 07:05:24
|
--- Inkommet från VCECMP.CHEFTH +46 16 151241 00-11-28 08:04 >From: mic...@ve... >To: VCECMP.CHEFTH@MEMO.VOLVO.SE >Date: Mon, 27 Nov 2000 08:33:04 -0800 >Subject: Re: [Sdcc-user] ESC Seq. > >Not when it is part of a string...0x041 is treated as a literal. > Hello again ! I have borrowed something out of a ANSI-C Compiler manual: Escape Sequences Character combinations consisting of a backslash (\) followed by a letter or by a combination of digits are called "escape sequences." To represent a newline character, single quotation mark, or certain other characters in a character constant, you must use escape sequences. An escape sequence is regarded as a single character and is therefore valid as a character constant. \xhhh ASCII character in hexadecimal notation All normal escape codes listed in Character Constants are valid in string constants. ----------------------End------------------------ I have also hade some testing and found out that if i use the following notation it works ! (though not ANSI) code unsigned char * code test="QW\0x041 QW"; If I remove the following whitespace or the trailing 0(zero) it doesn't work. If you look in the SDCCVal.c-file it uses: sscanf(s,"%x",&SPEC_CVAL(val->type).v_int); to find out the value of the escape-sequence. / Thomas ---- 00-11-28 08:04 ---- Sänt till ------------------------------- -> sdcc-user(a)lists.sourceforge.net |