I am trying to practice finding and correcting errors. I have a decent knowledge about C++ but not enough of course, which is why I am practicing.
- the end of a do while loop is where the error is... giving me an endless loop without stopping at some point in the output.
- I try to eliminate the "do" and simply just do the while loop. It did make a small correction but not perfected it. Instead it immediately stop or finish the program, however skip putting questions/input like phone numbers and answering Y/N question...
-I was trying to debug it but I don't see what is the actual problem.
P.S. I am running on Xcode if it makes any difference. I never experience running on windows compiler so I don't know if it works better there than Xcode.
I can't put the whole program on here because its over 9000 characters. but I'm putting the errors I have for two problems
1) while(----), getchar(), (code will never be executed)
2) length1/ length2 (Unused variable 'length1', 'length2')
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
while(choice==1||2||3||4||5||6);
getchar();
void office :: nameconcate (void)
{
int length1 = strlen(name1);
int length2 = strlen(name2);
strcpy(name,name1);
strcat(name1,name2);
}
|