Have you tried running your program?
Line 147: That line does nothing. You need to call function members of your class.
147 148
|
phoneBook.menu();
return 0;
|
Edit:
I see you're still making recursive calls to menu. There are a couple of reasons why this is a bad idea.
1) Every time you make a recursive call to menu(), a additional stack frame is pushed onto the stack. If your program is running for a long time, you will eventually fill the stack and your program will crash.
2) menu() has nothing to do with printing(), sortingAscd(), sortingDesc(), etc. Calls to menu() do not belong in those functions.
I would suggest embedding lines 16-45 inside a while loop. At line 43, after calling ending(),
return
to exit the menu function back to main.
Line 143: phoneBook should not be global. It should be a local within main().