required C code to sort files on the basis of file name and file size
File sorting algorithm in C?
ok......let say you have a file in the form of records in the form of structure.......i.r. you wrote records struct by struct...getting it na.....(if you dont then leave it and go start reading some yashwant kanetkar book)
no you have two option for sorting.......either you manipulate file pointers and sort in file only.......but i tell you easy way........
read all the records back to some array of stucts and delete the file and now sort this array......an then again create a new file with same name and write the array back to the file
Reply:you can also post your questions at http://www.tekpool.com/forums and get answers from a better suited community
Reply:This may or may not help you.
http://www.yendor.com/programming/sort/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment