Click here to Skip to main content
15,918,976 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
if we have to implement a file processing system, which data structure is best and why?
for example, if i hv to store the details like, id,name, and class of students.
Thanks in advance
Posted
Updated 16-Jun-11 4:40am
v2
Comments
CPallini 15-Jun-11 15:25pm    
'The one that fits well with our file processing system'
Sergey Alexandrovich Kryukov 15-Jun-11 16:03pm    
Not clear, too general question. It depends.
--SA
Keith Barrow 15-Jun-11 16:47pm    
I have to agree, your question isn't clear: what is the file processing you need to do?
s_aslam98 16-Jun-11 10:39am    
for example, if i hv to store the details like, id,name, and class of students.

Parse the source file and store it in a database.
Perform all processing operations on the database table rather than the source file.
 
Share this answer
 
Comments
Albert Holguin 16-Jun-11 11:50am    
that would probably be the most efficient method.. my 5
s_aslam98 wrote:
if i hv to store the details like, id,name, and class of students

An option is Object Serialization[^] a very powerful and elegant mechanism.
All the programming languages you tagged support such technique (C++ via 'external' libraries, like MFC: in fact serialization is one of the good things of MFC).
Using object serialization the proper data structure for the student details would be, precisely, a Student class and you would have as many instances of such class held by a container of your choice (for instance, using C++, a std::vector) whenever needed, the serialization mechanism would provide the way to load from file (or store to file) the container content.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900