int x = std::numeric_limits<int>::max();
int y = std::numeric_limits<int>::max();
longlong z = ( longlong )x * y;
std::cout << "x = " << x << std::endl;
std::cout << "y = " << y << std::endl;
std::cout << "z = " << z << std::endl;
The result is
x = 2147483647
y = 2147483647
z = 4611686014132420609
Or you can use unsigned int and unsigned long long if you deal with unsigned numbers.
The other way is to use std::string as number representations and apply std::transfrom algorithm. :)
In C you can use character arrays instead of the class std::string.