Link to home
Start Free TrialLog in
Avatar of koger
koger

asked on

read from/write to file

Could anybody give me a simple exaple about how to store information in a file and retrieve then again
ASKER CERTIFIED SOLUTION
Avatar of sureshkumar
sureshkumar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of koger
koger

ASKER

Hi

in the write line, what does this mean?
(char*)&o1

Is this the normally used way to write to file today, it seems a little DOS'ed


Can you explain me how this works

reinterpret_cast<char * >( &x[1] )

x: array of char
Avatar of koger

ASKER

Hi

in the write line, what does this mean?
(char*)&o1

Is this the normally used way to write to file today, it seems a little DOS'ed


Can you explain me how this works

reinterpret_cast<char * >( &x[1] )

x: array of char
(char*)&o1

what ever in the object on o1 (i.e., either int or char or double) it will be stored as strings in file.

thanks
suresh kumar

Avatar of koger

ASKER

ok you didn't what to comment:

Is this the normally used way to write to file today, it seems a little  DOS'ed?

Thanks
koger
hi koger

Yeah, till today i used this.If you know updated way( i.e., writing in to file). please tell me,I am waiting for your answer.Since i am very intersted to know new things.otherwise give me sometime i will confirm and comeback to you

thanks
suresh kumar