Connecting Tech Pros Worldwide Help | Site Map

Saving int,char etc... in C++ to work with later

Newbie
 
Join Date: Sep 2007
Location: Slovenia
Posts: 17
#1: Sep 27 '07
i want to ask how can you save like for example char , or a string in c++ for multiple uses. like when you close the program and when you reopen it you can see what you entered.
i need this to know how exacly ill make the adress book which can be used quite useful
Savage's Avatar
Expert
 
Join Date: Feb 2007
Posts: 1,737
#2: Sep 27 '07

re: Saving int,char etc... in C++ to work with later


Quote:

Originally Posted by mitola

i want to ask how can you save like for example char , or a string in c++ for multiple uses. like when you close the program and when you reopen it you can see what you entered.
i need this to know how exacly ill make the adress book which can be used quite useful

You can do that with files,or with not using clrscr(offcourse if you after running your program you run it again).I suppose that you prefer files.Do you know to work with them?No?If so find some good tutorials(you have here in c++ articlesHav section artcile:How to parse a file?)

Have fun..

Savage
Newbie
 
Join Date: Sep 2007
Location: Slovenia
Posts: 17
#3: Sep 27 '07

re: Saving int,char etc... in C++ to work with later


thanks mate. ill try my best
Newbie
 
Join Date: Sep 2007
Location: Slovenia
Posts: 17
#4: Sep 27 '07

re: Saving int,char etc... in C++ to work with later


em could you just post link it give me strange results and i do not find corect article i think
Savage's Avatar
Expert
 
Join Date: Feb 2007
Posts: 1,737
#5: Sep 27 '07

re: Saving int,char etc... in C++ to work with later


Quote:

Originally Posted by mitola

em could you just post link it give me strange results and i do not find corect article i think

Sure,here you go.

This article covers file parsing,but you can conclude from it how to write to the file.If you still have problems after reading this article, then you can perhaps find something good from here
Savage
Newbie
 
Join Date: Sep 2007
Location: Slovenia
Posts: 17
#6: Sep 27 '07

re: Saving int,char etc... in C++ to work with later


veeery nice , i was also looking for a nice pointers tutorial very useful. ill get my hands on work right now
Newbie
 
Join Date: Sep 2007
Location: Slovenia
Posts: 17
#7: Oct 9 '07

re: Saving int,char etc... in C++ to work with later


i dont know something about files. how can you modify the text by alpahabet. its not meant every leter but the lines for exm.

not modifyed:
number
leter
root
car
auto

modifyed:
auto
car
leter
number
root

and how can you compare two lines when doing with files.
Reply


Similar C / C++ bytes