long long int val = 145548784578788;
char str[0x20]{}; //定义一个内存
int index{ 0x1F }; //长度
bool result = val >= 0; //是不是正数
val = val * (result * 2 - 1); //取绝对值
do str[--index] = val % 10 + 48;while (val = val / 10);
str[index = index - (1 - result)] = '-' * (result + 1) * (1 - result) + str[index] * result;
std::cout << &str[index] << std::endl;