C++/Urgently Required:File Handling Problem
Expert: Prince M. Premnath - 9/25/2006
QuestionHello!
i am in great trouble kindly help me.
i want to read a file in c++ program.the file that is to be called in the c++ prog consisting of data in 2 cols and 100 rows.like that
tokens freq
sdfsdf 20
dsd 51
i want to store the 2cols in two arrays
for ex. array1[]consisting of col1
array2[]consisting of col2
whereas col1 consists of combination of characters.col2 is of integer form.
how to store the data in arrays[] reading from a file.
Kindly send source code in C++ urgently.thanxs in advance.bye
AnswerThats simple declare a separate structure for the RECORD and write to the file as a record and not as a piece of elementry data !
And while reading do the same , extract the expected information from the record and manipulate !
I didn't have code for this ..
Thank you !