C file handling query

write a program in C to implement the following :

1. Application read data from the text file name input.txt
the data that will be read in this format

Name Adress Age
“DAli Akbar”,”Surakarta”,14
“BAli Akbar”,”Surakarta”,14
“Ali Akbar”,”Surakarta”,14
“CAli Akbar”,”Surakarta”,14

2.Save data names,adress,age to array then sorting based on name.
Print Sorting result to the screen

3. Ask the user to write Sorting Result To the text [yes/no]
if yes then sorting result write to text files name output.txt with this format

Ali,25,Solo
BAli,25,Solo
CAli,25,Solo
DAli,25,Solo

Please give me some advice as to how i should do the above program.
Any codes regarding the above are also welcome.
Now I realise that this probably a homework assignment - as such I (nor others I think) am not going to write it for you. You won't learn anything that way.

We can help you if you provide at the least some thoughts on how you are going to do it.

The assignment is well setout and provides half the algorithm.

Look at what you need to do:

1. How to open and read text files
2. How to put info into an array
3. How to sort things

I am guessing that your tutor/ lecturer has already given you all quite a bit of info already, and you have a text book on the C language. The C Language by Kernigan & Richie is one of the best books. You also have Google. There is a lot of stuff on this website.

BTW I am not a tutor or anything - I just like to help. So do a little bit of work yourself, then we can help from there.

Hope this helps.

TheIdeasMan
Topic archived. No new replies allowed.