( Above is an example of use )
I basically adjusted my mIRC $powerOf snippet for use in C++ to help me learn (only been doing this for 2 days).
Snippet requires some sense as if you use ridiculously high numbers, you WILL overload it. Please also note that due to use of "int" instead of "float" decimals cannot be used.
#include <iostream>
using namespace std;
int main ()
{
int x = 1, y = 1, inputStartNumber, inputToNumber, inputConstant;
int * result;
result = new int [5];
cout << "Enter starting number: ";
cin >> inputStartNumber;
cout << "Calculate [ " << inputStartNumber << " ] to the power of: ";
cin >> inputToNumber;
inputConstant = inputToNumber;
cout << "[1] " << inputStartNumber << "\n";
while ( x < inputConstant )
{
inputStartNumber = inputStartNumber * inputStartNumber;
result[x] = inputStartNumber;
x++;
}
while ( y < inputConstant )
{
cout << "[" << y+1 << "] " << result[y] << "\n";
y++;
}
main ();
}