To (mostly) answer your questions above: yes, you will need functions and pointers, and printf is fine for menus. I suggest fgets for reading data from the user, it reads a whole line (everything they type, until, and including when they press enter).
A general approach I use:
- Read the problem, and make sure you understand what it is asking
- Figure out how to solve this by hand, on paper. Ignore things like details of opening a file, whether to use while or for loops, etc. Come up with a solution in plain English, or whatever your native language is. Note, if you don't know how to solve this yourself, there is no way to program a computer to do it.
- Try out your solution. Run through some examples with paper and pencil. You can make a fake "file" with data, on a separate sheet of paper, and "read" through that one char at a time. Keep track of every little step you take, write it down. That will be the basis for your algorithm.
- Take those steps written down in English, and translate them to pseudo code. Psuedo code should have roughly the same basic structure as your actual code, but you get to ignore the details and some of the error checking for now.
- Once you have your pseudo code, begin turning it into real C code. Work in small chunks, write no more than 5-10 lines at a time, then test that. By test, I mean compile your code with maximum warnings, and fix all errors and warnings, and run your code to make sure it behaves the way you expect.
- If you encounter problems, fix them immediately, before you move on. That way, if an error pops up, you know it was in the last 5-10 lines of code, and it's easy to fix.
- Continue the previous two step until you have fully implemented your solution to the problem.
Good news for you, you have been given a decent program specification. You are told the exact menu options. When it's time to write code (which is not yet), I would probably start with the menu. Make sure your menu works, so it will be easy to test the other functions as you add them.
Once your menu is working, I would work on defining the data structure you will use. You are told the exact type of data for each piece of info you want on the person, along with limits (e.g. age is 18-99 years, 32 chars for names) for validating input. If you have learned about structs, I would use a struct to hold all this info.
Some more tips:
- I would probably have my main function only declare the necessary variables, and call the main menu code. Let the functions do their jobs.
- Make sure you use good, clear names. A function like clearAllData would be an example. It would clear all the values, setting them to whatever "unknown" values you use.
- Use plenty of functions. There should be at least one of these per menu item, possibly more.
- Use sensible values for "unknown" info. For example, an age can't be -1, so you could use that to represent "unknown age". Then, when you print (in your printData function), if age was -1, you would print "Age: unknown", otherwise, print "Age: 42" or whatever. A string like firstName could be length 0 (firstName = '\0') to signify unknown.
That should be plenty to get you going.