Its not necessary to initialize std::strings with blanks because that is the default. Just declare them like this: std::string softserve, topping, sprinkles;
I think your program needs more cin statements for data entry.
Ancient Dragon
Retired & Loving It
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
If you wrote that then you should know why. You should also reformat the code to make it easier to read and understand. Example below:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string softserve, topping, sprinkles;
string order;
do
{
if (softserve == "")
cout << "Do you want chocolate, vanilla or twist?\n"; // endl not needed here
if (topping == "")
<snip>
Ancient Dragon
Retired & Loving It
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
I got that same output with the code you posted.
Ancient Dragon
Retired & Loving It
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
The instructions you originally posted are very confusing. Is that the exact wording of the assignment, or just how you interpreted it. Please post exact assignment.
Ancient Dragon
Retired & Loving It
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
Sorry, I'll have to get to this tomorrow evening if someone else has not answered your questions by then.
Ancient Dragon
Retired & Loving It
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341
instead of system(pause>nul) why didn't you just simply use cin.get() ? you wouldn't have to have done all that net searching :)
Ancient Dragon
Retired & Loving It
30,042 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,341