Here is my code so far:
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
string exp;
cout << "Enter a number and raise it to a power" << endl;
cin >> exp;
int num = exp[0];
int pow = exp[2];
cin.get();
cin.ignore(256,'\n');
}
Basically, I'm trying to make a program where you can enter something like "2^5" and it will solve it for you. So far, I have taken the first and third values of the string and called them "num" and "pow". (Number, Power) If you try something like "cout << num;" it will give you the decimal Ascii value. How do I convert it to a decimal?