Char
#include <stdafx.h>
#include <iostream>
using namespace std;
/* Char types are stored in 8 bits. */
int main()
{
char ch1 = 'M',ch2;
cout<<"Character is : " << ch1 << endl;
ch1 = 88; // code for X
ch2 = 'Y';
cout<<"ch1 and ch2: ";
cout<<ch1 << "," << ch2 << endl;
ch1++; // increment ch1
cout<<"ch1 is now :" << ch1;
return 0;
}
Output:
Character is : M
ch1 and ch2: X,Y
ch1 is now :Y