1// getting the legth of an int by turning it into a string
2// works with double and float too
3
4#include <iostream>
5
6int num = 0;
7
8// turning num into a string using std::string
9std::string temp = std::to_string(num);
10
11// getting the length using .length()
12int len = temp.length();
13