however all the books I have bought are crap they deal with OOP and almost nothing is said about files except that ios::app appends ...etc.
I am trying to read in a file and not trunc it and be able to seek in the file and output the changed values to a created file while leaving the origianl file unaltered.I chose c++ because it is portable, I didn't know that the books I bought wouldn't tell me how to read certain portions of a file and output to another. I have about eight books -all are useless concerning this.
Can someone please reccomend a good book on this or a tutorial? I really don't care about the OOP stuff yet.
Also is 1A the EOF like it is in assembly?
#include <iostream>
#include <fstream>
#include <string>
usingnamespace std;
int main()
{
string Input_Filename = "Your_input_File_Name.ext";
string Output_Filename = "Your_output_File_Name.ext";
ifstream input_File(Input_Filename, ios_base::in); /* This is your input file handle*/
ofstream output_File(Output_Filename, ios_base::app); /*This is your output file handle*/
/*What do you want to do with the data?*/
Thanks
I want to read in 4 unsigned chars and alter them and output to another file the altered chars and then increment to do the next 4 unsigned chars in the input file to the output file.
I am confused about how to go about doing this. My books don't tell me anything about how to work with input files they are only concerned with writing structs to output files.