You are to create an application which stores information about people, along with a ‘task list’. The application’s functionality can be described as follows:
•The user should be able to store peoples’ names along with several pieces of information about each person (age, telephone number, favourite football team etc.).
Should I use char to store the information with as I need to be able to search it later or should I use string? Also as I need to be able to search by age too how can I use age into the same array?wouldnt I need int for this?
If you are a beginner (don't know anything about struct or class) then I highly recommend you pick a tutorial about the struct rather than class, as classes are actually Object Orientated Programming which is a much more complex area (not going to explain now why, but trust me, better hang on with struct for now).
If you need help on understanding structs, either PM me, or just ask me in here. Though, it's not such big deal, and if you google it, I'm quite sure you'll get it.
well I understand classes(sort of) Ill search up structs now . But I think I have done this too just don't know what its called? I mean I do object orientated programming as a module so I should have done it.
If I use structs or classes would I be able to use a search algorithm to find the data? eg if I searched for someone by age or such ? Im completely lost on this task.
The whole reason for using class/struct is to organize your code more efficiently and actually make it easier to create a search algorithm to find the requested data. I say easier, given you already know how to use class/struct. If you don't know then then there's a learning curve but it's well worth it. Structs are simpler, have less syntax to learn and should fit your program better given its current size.
On the other hand you can (almost) continue with what you have. It won't scale easily but it'll get the job done. Everything currently gets stored in information[i][j] so you could add a menu that asks the user if he would like to add 'information' or return an item from 'information' and list the options. You'll need a function to replace an old entry/warn the user of an old entry first.
'(almost)': About the search feature - it would probably be easier to store integer values into an integer array and string values into a string array meaning that you'll need 2 arrays (parallel as was mentioned earlier). Then, when the user searches for a specific age, u'll be able to return the entry it was found. Similar with a person's name. So that when you print the entry 5, it'll print age,telephone, etc from the integerarray[all] and the stringarray[all].