help for save list

hi
i have a struct like this
1
2
3
4
5
6
7
struct list
 {
   char[10] name;
   char[20] family;
   int age;
   int tel;
 }

and i can't save this to .txt file.
can anyone help me.

tanks for your future help.
http://www.cplusplus.com/doc/tutorial/files/

Any specific problems you're having?
no tanks a lot
I'm new here and i don't know the topic
this is my new problem in project.
i create a project in first compiler error my .def file
and when i delete my .def file this error come up
" you have accidentally used the dummy version of OwlMain "
please help.
I really don't know. What compiler and ide are you using?
borland c++ version 5.02
Your compiler is out of date. Update to one of the free alternatives:

Turbo C++ Explorer
http://www.turboexplorer.com/cpp

GCC (MinGW)
http://www.google.com/search?q=mingw

Microsoft VC++ Express
http://www.microsoft.com/express/Windows/


To write a file, you should have a specific "file format" in mind. In other words, how will your file look?
For example, you could store your information in a regular text file like this:

Harrison,Ford,68,5551234
Annette,Funicello,68,5554321
Will,Smith,42,5556789
Anne,Hathaway,28,5559876

Once you decide on a file format, you just need a couple of functions -- one to write a "person" (don't call a person a "list"), and one to read a "person".

Hope this helps.
tank you but it's not help me
i don't find what i need.
my system is windows.

i need to know what the .def file is?
and
what am i writing on it?

problem with save to .txt file :
this error come's up ( 'is_open ' is not a member of 'ofstream' )
this is the code
 
if ( myfile.is_open() )
Last edited on
It is not helping you only because you have not taken the advice.
Your compiler is too old to do what you want.
i find a way to save struct on .txt file now i need help for
load a save word to c++?
-----
and another think this is how save or because my compiler old it's like this
when i write this ( "hello cplusplus" ) it write hello and if i'm gonna
write the word it come like this ( " hello-cpluspluas " ) is it correct?
Last edited on
Topic archived. No new replies allowed.