Y
YUS
First of all, I'm a c++ beginner.. as u will see..
I'd like to do this:
- The code open a file
- it searchs for the string "BUDGET = "
- the budget value is overwritten or at least the entire row.
CODE:
fstream file;
memset(buf,0,512);
file.open(nomefile, ios:ut | ios::in);
do{ file.getline(buf, 512, '\n');
} while(!strncmp(buf, "BUDGET", 6));
file << "BUDGET = " << budget << endl;
The problem is that the file is not written, no changes are made to the
file.
I've also tried with ios::app but with no results.
How I can do ?
Thanks to all.
I'd like to do this:
- The code open a file
- it searchs for the string "BUDGET = "
- the budget value is overwritten or at least the entire row.
CODE:
fstream file;
memset(buf,0,512);
file.open(nomefile, ios:ut | ios::in);
do{ file.getline(buf, 512, '\n');
} while(!strncmp(buf, "BUDGET", 6));
file << "BUDGET = " << budget << endl;
The problem is that the file is not written, no changes are made to the
file.
I've also tried with ios::app but with no results.
How I can do ?
Thanks to all.