I want to change the mode of access to
code
ofstream transfer;
\code
so that I can alternately overwrite or append to it. What kind (type) of variable should I use to hold "ios::app" or "ios::out" ?
This is the point at the program:
code
string label("2");
.....
some code that may chage label to "1";
..........
if (label == "1") {transfer << setiosflags(met hod);};
/code
and I should have method to be either of "ios::app", "ios::out" .
I have tried
code
string method;
/code
and then
code
setiosflags(met hod.c_str())
/code
withouth success. I know that ios::app is equivalent to 8 or is it equivalent to "8"?
Thanks for help
Tarcisio
code
ofstream transfer;
\code
so that I can alternately overwrite or append to it. What kind (type) of variable should I use to hold "ios::app" or "ios::out" ?
This is the point at the program:
code
string label("2");
.....
some code that may chage label to "1";
..........
if (label == "1") {transfer << setiosflags(met hod);};
/code
and I should have method to be either of "ios::app", "ios::out" .
I have tried
code
string method;
/code
and then
code
setiosflags(met hod.c_str())
/code
withouth success. I know that ios::app is equivalent to 8 or is it equivalent to "8"?
Thanks for help
Tarcisio
Comment