char

Hi

I cannot grasp how to use char would someone be kind enough to show me some examples and thanks so much for all passed responses.

char g;

g = 23;


std :: cout << g << endl;


I am getting a character change to cout for example u becomes y??
It also helps to understand the ASCII code chart.
http://www.asciitable.com/

 
  g = 23;

assigns the decimal value 23 to the char variable g. Values less than 32 (space) are non-printable. Your OS may or may not have a display representation for a char with a value of 23.

Topic archived. No new replies allowed.