hi, i am trying to make a calculator and i have this code
#include<iostream>
#include<sstream>
using namespace std;
int main (char argc)
{
int l = 1;
for(l = l; l > 0; l--)
{
int q = -2;
string n1 = "1+5";
int n;
int e;
stringstream(n1[q=q+2]) >> n;
stringstream(n1[q=q+2]) >> e;
cout << n + e << endl;
}
system("pause");
}
this is just a test program i use to figure out hard problems with the original one. so if i dont use stringstream, the answer doesnt come out right. any solutions?