C++ Help

Mu online season 21 - grand opening

Stonehelm

Resigned
Golden Oldie
Apr 14, 2004
1,270
0
123
Preston, UCLAN
I need help with an Assignment, anyone confident enough in C++ to help me rectify a problem. Should be farely straight forward.


Would post the actual problem here but LOMCN is scanned by Google and plaigarism could be a problem.
 

Damian

LOMCN Developer
Developer
Ravagers
Game Master
Jun 13, 2003
1,184
154
290
Attach it in a txt file, I don't mind taking a look :P
 

Stonehelm

Resigned
Golden Oldie
Apr 14, 2004
1,270
0
123
Preston, UCLAN
Cheers dude, dont worry about the formating im gonna sort that out at the end.

Basically its a crappy carpet quote program, will try to explain the problem in as much detail as possible:

I have a Do While loop around the entire program because the user is asked the question at the end "Would you like another quote" if they input "Y" or "y" the program loops back to the start, the only problem is that it complete skips the "Enter your initals and surname". Im fairly certain its to do with the cin.getline but i dont know enough to fix it.


 

Attachments

  • CostOfCarpet01.txt
    5.4 KB · Views: 6

Dataforce

LOMCN VIP
VIP
Apr 15, 2003
2,080
0
263
add
Code:
std::cin.ignore();
above
Code:
}while (Quote == 'y' || Quote == 'Y');
 

Damian

LOMCN Developer
Developer
Ravagers
Game Master
Jun 13, 2003
1,184
154
290
Rather than using a loop there, you might be better off using a goto statement.

crap example below, but kinda demonstrates it..

BOOL fOk = TRUE;
label test:

for (int i = 0; i <= 10; i++)
{
printf("testing");
}

if (fOk)
goto test;