📅  最后修改于: 2022-03-11 14:44:48.292000             🧑  作者: Mango
// getting the legth of an int by turning it into a string
// works with double and float too
#include
int num = 0;
// turning num into a string using std::string
std::string temp = std::to_string(num);
// getting the length using .length()
int len = temp.length();