The only way I know is:
#include
#include
using namespace std;
int main() {
int number=33;
stringstream strs;
strs &l
Converting our integer value to std::string so we can know how long (how long number of digits).
Then we creating char array length of string letter size +1, so we can copy our value to string then char array.
#include
char* intToStr(int data) {
std::string strData = std::to_string(data);
char* temp = new char[strData.length() + 1];
strcpy(temp, strData.c_str());
return temp;
}