I have it so when a user presses a key it shows up and i have the ability to put strings or just a char on the screen.
I have been trying to make a simple, very simple calculator. I can add/multiply/subtract/divide digits 0-9...but when i get to double digits that is where i fall...hard...
So i decided to make a buffer to hold all of the keyboard data entered before the enter key is hit.
i have tried this
Code: Select all
while(x < index)
{
if(buffer[x] == '+')
{
argument = '+';
x+=1;
flag = x;
}
if(buffer[x] != '+')
{
if(flag == 0)
{
data_1[x] = buffer[x];
x+=1;
}
if(flag != 0)
{
data_2[x] = buffer[x];
x+=1;
}
}
}
any suggestions?