easiest way to convert int, unsigned int and float to string with or without library

i need to print numbers to the screen but i can’t be putting print("123"); incase i’m making a calculator. because variables, as the name suggests, you know. can’t have like

if (a==0) {print("0");}
else if (a==1) {print("1");}
...

so is there a way to convert long long, unsigned long long and long double to string? (in my case, char*) note – i’m using c++ in gcc 9.3.0 on ubuntu 20.04.

Source: Windows Questions C++

LEAVE A COMMENT