char variables are just 8-bi integers. int variables are usually 32-bit integers. You can convert freely just by assignment or initialization:
-
int data = 65;
-
int data 1 = 'A'; //same as above line 'A' is 65.
-
char c = data; //c has 65
-
cout << c; //you see A
-
cout << data; //you see 65
-
That means you don't need a function to do this.
On the display, you see 65 or A depending upon the type of variable on the right side of the << operator. If it is a char, an operator<< function is called that takes a char argument. This function will show you A. If it is an int, another operator<< function is called that takes an int argunment. This function will show you 65.
The compiler will give no warning if the value in your int is too big for your char.