>>I've read through some of the pages in your sig but I still don't
get it.
I didn't put a link for cin.getline in my sig, but do look at the link
about gets - its an old function that can easily crash your program
if a person enters too much data. The reason I have an fgets link
is because people don't tend to use gets in C++, its a C function
and fgets is the more modern version.
>>The 'q' part works fine
I'm sure it does, i wasn't contesting that it wouldn't. The reason
i suggested using integers is to get around my next point (in
using integers, entering q would obviously be invalid).
>>how would I get around the fact the switch statement only
looks in the first element and not the entire string?
You cant - at least not with a switch statement. You could make
this program work using an if/else block and using strcmp.
Code:
if (!strcmp(option, "1"))
{
//do stuff
}
else if (!strcmp(option, "2"))
{
//do stuff
}
else if (!strcmp(option, "3"))
{
//do stuff
}
else if (!strcmp(option, "q"))
{
//do stuff
}
else
{
//do default stuff
}