Hi! I've already posted this and didn't get the results I was looking for.
Goals: for this program, I am having problems A) entering integers into a string's element and B)pulling out the integer and adding it to what the user inputs, and restoring it.
Here is the code that I'm having some problems with:
A)
1 2 3 4 5 6 7 8 9 10 11
|
const int CookieSales = 8;
string a[CookieSales];
string b[CookieSales];
string c[CookieSales];
string d[CookieSales];
string e[CookieSales];
string f[CookieSales];
string g[CookieSales];
string h[CookieSales];
string l[CookieSales];
string m[CookieSales];
|
B)
1 2 3 4 5 6 7 8 9 10 11
|
cout << "\n\n" << CookieNames[0] << " = " << a[0];
Sales();
cout << "Boxes sold: ";
cin >> sales;
//prevsales += sales;
//a[0] = prevsales;
cout << "\nNew records for " << CookieNames[0] << " are " << a[0] << ".\n\n";
|
Here is a webpage that has all of the code that I have thus far if any one needs to see the whole thing:
http://markc81896.hostzi.com/Cookie%20Counter%204.html
Note: I've already been told to do both of these:
Here is how to store a number.
a[0] = 3;
Here is how to store the value of an already existing int.
a[0] = someInt;
Neither way worked, but they didn't see the whole program.
Later on I'll end up cleaning it up. A lot of the commented out code is there so I don't try something that I've already tried and it didn't work.
Thanks in advance!