http://ideone.com/e.js/qxX7AS
(The program code was too long. Hence, please follow the link to the program code. Also, I am not using the website's compiler to run the program. I did that just to make the program code available.)
Viewing a patient, viewing all patients, etc. are not working properly (everything that searches according to ID). Only the add function is working properly.
Also, it doesn't go back to PAT() when main() is called.