Saturday, 1 June 2013

Violation of the C definition?

Violation of the C definition?

The C standard states that any character in the machine's standard printing set will never be negative.But the following code:
char c=1234;
printf("%d\t%c",c,c);
gives a negative output and prints a strange character,meaning that the character is in machine's printing character set.Is the C standard being violated here?

No comments:

Post a Comment