Thread View: att.lang.c++
2 messages
2 total messages
Started by Hakan Venderlof
Sun, 05 Sep 1999 00:00
load and save variable
Author: Hakan Venderlof
Date: Sun, 05 Sep 1999 00:00
Date: Sun, 05 Sep 1999 00:00
23 lines
970 bytes
970 bytes
Hello I would like to load an variable from a file variable.txt looking like this: 25 and then change the variable in a program and save the variable to the samefile, eg overwriting the file to for example 50 How should this be written? I use Borland c++ 5.02. -- *** greetings grok sweden ***
Re: load and save variable
Author: Bart and Debbie Crane
Date: Mon, 06 Sep 1999 00:00
Date: Mon, 06 Sep 1999 00:00
25 lines
1173 bytes
1173 bytes
If you can read standard input, then sscanf is the easiest for C. If it's C++, then if it is Windows, then you might want to be reading and writing the Registry, or some .ini file? In which case you should use the Win32 API. Hakan Venderlof wrote: > Hello > I would like to load an variable from a file > variable.txt looking like this: > > 25 > > and then change the variable in a program and > save the variable to the samefile, eg overwriting the file > to for example > > 50 > > How should this be written? > > I use Borland c++ 5.02. > > -- > *** greetings grok sweden ***
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads