c++ - how to assign an int to char* with operator overload -


this question has answer here:

i have class saves big numbers string , can general mathematical operations on it. 1 of these operations assigning int (0-9) 1 digit of big number. question how can overload operators , convert int value char* , save instead of digit in string. following code should work:

\\ bignumber[3] == '8' bignumber[3] = 4 \\ bignumber[3] == '4' 

you can convert string

int number; std::ostringstream stream_string; stream_string << number; string numberstring = stream_string.str(); 

if want convert string char*

bignumber[0] = numberstring.c_str(); 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -