I have a couple of questions about the following snippet:
1 2 3
|
cout<<"Customer name: ";
cin>>name[100];
cin.getline(name,100);
|
First why are you trying to have the user enter the name twice, first with the extraction operator then with getline()?
Second why is name an array of char instead of a std::string?
Third do you realize that in the code above you are accessing your array out of bounds when you try to extract a single character into the 100
th element? Remember valid array indexes are 0 to size - 1, 100 is one past the end of the array. Do you realize that that line is actually retrieving a single character? To retrieve C-string you wouldn't use the [100].
You may want to re-examine your code, making sure every beginning brace { has a matching ending brace } and there are no mismatches.
Because of your inconsistent indentation it's hard to read the code so this is all I'll comment about for now, except to notice you have a function named exit(), you shouldn't use this name for your function, there is already a standard function with that name.