#include <iostream>
#include <string>
#include <new>
usingnamespace std;
#define K 1000;
#define k 1000;
#define M 1000000;
#define m 1000000;
int main()
{
string name;
char cash_pile[10];
string answer;
char bet[10];
cout<<"hi this is a calculator to calculate dicing percentages"<<endl;
cout<<"what is your name?"<<endl;
cin>>name;
cout<<"how big is your cash pile right now?"<<endl;
cin>>cash_pile;
cout<<"your name is "<<name<<" and you currently have "<<cash_pile<<" GP is that correct?"<<endl;
cin>>answer;
if (answer=="yes" || answer=="y" || answer=="Y" || answer=="Yes"|| answer=="yep" || answer=="Yep" || answer=="Yea" || answer=="yea")
{
cout<<"okay how much are you going to bet?"<<endl;
cin>>bet;
cash_pile-bet=result; //right here it says need modifiable l value, I know the problem is that they are static arrays I just cant think of a way around it.
}
system("pause");
}
Yea thats the problem though, the reason i had it as an array is because I want to be able to input K and M to represent thousand and million. thats why int wouldnt work. Any way around this?
haha no int goes to a million but I want the user to be able to input lets say 10M. and the program will recognize that as 10000000, that is what I have yet to understand.
Okay, so in this case, you'll read cash_pile as a string or char*, however you will then need to parse the string/char* and manipulate it until you get a numeric value of 10000000. You are missing that step. You can't do math operations on a string or char*.