CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

char

the type "char" designates a variable that is supposed to store a character (text).

char letter,choice='Y';
letter='a';
if (choice=='N') break;
letter= ' ';

 

  • char variables can be compared, assigned and initialized as any other variable.
  • each variable stores one character; an array is needed to store several characters.
  • uppercase and lowercase characters;
  • blank is also a character;
  • character codes.