I wrote following program
int main ()
{
char a=0xf;
a=a+1;
printf("%c\n",a);
}
the output of above program is what I am not able to understand.It is giving me some character which I am not able to understand.Is it possible to find out ASCII code of the character that I am getting in my above program so that I understand what is it printing.
EDIT
Based on the replies I read I am adding further to my confusion
if I write a statement as following
char ch=’Z’;
then what would be stored in ch,
1) The character Z
2) ASCII value of Z
3) Z along with single inverted commas
4) Both (1) and (2)
The characters from 0 to 31 are non-printing characters (in your case, you’ve chosen 0xF, which is 15 in decimal). Many of the obscure ones were designed for teletypes and other ancient equipment. Try a character from 32 to 126 instead. See http://www.asciitable.com for details.
In response to your second question, the character stores the decimal value 90 (as characters are really 1-byte integers).
'Z'is just notation thatZis meant to be taken as a character and not a variable.