int x and char(x)

int x is used for declaration of x and in memory a space is reserved for x variable but what happens when i use char (x)? like i mean what is the concept behind it? please explain in easy words as i am new to programming
THANKS!

char(x) converts x to char type.
For examlpe this line will print "c" to console 'cuz 99 is code of that leter
std::cout << char(99);
, also this:
1
2
int x = 99;
char ch(x); // the same as char ch = 99; 

will set ch to 99 so ch = 'c'
Last edited on
Topic archived. No new replies allowed.