You are here:

C++/Urgently Required:File Handling Problem

Advertisement


Question
Hello!
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


Answer
Thats 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 !

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise

Years of research in C/C++ Will bring you all facts regarding , OOPS , SVGA , MOUSE , BIOS , IVT , Feel free to query me :-)

Experience

More than 5 years

Education/Credentials
MCA

©2016 About.com. All rights reserved.