C++ recursive function for power.