M
Mateusz_madi
Hi why when i write:
printf("%c", \11); i get S??
printf("%c", \11); i get S??
Mateusz_madi said:Hi why when i write:
printf("%c", \11); i get S??
Hi why when i write:
printf("%c", \11); i get S??
Op Wed, 29 Dec 2010 09:42:11 -0800 (PST) schreef Mateusz_madi:
You don't, the program will not compile because of a stray '\'.
[...] Coos Haak said:Op Wed, 29 Dec 2010 09:42:11 -0800 (PST) schreef Mateusz_madi:
Hi why when i write:
printf("%c", \11); i get S??
You don't, the program will not compile because of a stray '\'.
Interesting that you say that...
On my system, I get S, just like the OP.
[email protected] (Kenny McCormack) said:[...] Coos Haak said:Op Wed, 29 Dec 2010 09:42:11 -0800 (PST) schreef Mateusz_madi:
Hi why when i write:
printf("%c", \11); i get S??
You don't, the program will not compile because of a stray '\'.
Interesting that you say that...
On my system, I get S, just like the OP.
OK, then I suggest you to study your compiler documentation for
the meaning of the diagnostic message "S". You apparently know
little about C, but believe me: the statement above requires a
diagnostic message and those have to be documented by the
implementation.
-- Ralf
Mateusz_madi said:Ok, wrong question asked, why: printf("%d", '\11'); gives 9 ?? What
this \ means ?
Mateusz_madi said:Ok, wrong question asked, why: printf("%d", '\11'); gives 9 ?? What
this \ means ?
Mateusz_madi said:Ok, wrong question asked, why: printf("%d", '\11'); gives 9 ?? What
this \ means ?
BartC said:Probably '\11' specifies a character constant with the given numeric
code \11, where 11 is octal notation (why octal, I don't know; maybe
everyone used octal in the 70s).
And 11 in octal is 9.
I don't know how you managed to get S out of it.
Hi why when i write:
printf("%c", \11); i get S??
That's the whole code:
char input[]="SSSWILTECH1\1\11W\1WALLMP1";
case 9 : putchar('S');
Additionally i have question how: /*case 'E' : case 'L' : continue; */
works,
and what is the difference between /* case 1 */ and /* case '1'
*/
OK, then I suggest you to study your compiler documentation for
the meaning of the diagnostic message "S". You apparently know
little about C, but believe me: the statement above requires a
diagnostic message and those have to be documented by the
implementation.
Ok, wrong question asked, why: printf("%d", '\11'); gives 9 ?? What
this \ means ?
Mateusz_madi said:Ok, wrong question asked, why: printf("%d", '\11'); gives 9 ?? What
this \ means ?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.