What is the easiest way to convert from int to equivalent string in C++. I am aware of two methods. Is there any easier way?
int
string
(1)
Use:
#define convertToString(x) #x int main() { convertToString(42); // Returns const char* equivalent of 42 }