1// for example you have such integer
2int i = 3;
3
4// and you want to convert it to a char so that
5char c = '3';
6
7what you need to do is, by adding i to '0'. The reason why it works is because '0' actually means an integer value of 48. '1'..'9' means 49..57. This is a simple addition to find out corresponding character for an single decimal digit integer:
8
9i.e. char c = '0' + i;
10
11If you know how to convert a single decimal digit int to char, whats left is how you can extract individual digit from a more-than-one-decimal-digit integer
12
13it is simply a simple math by making use of / and %
14
15int i = 123 % 10; // give u last digit, which is 3
16int j = 123 / 10; // give remove the last digit, which is 12
17The logic left is the homework you need to do then.
18
1std::string s = std::to_string(number);
2char const *pchar = s.c_str(); //use char const* as target type