D
dumboo
hi there
i have been trying to open file using fstream, in read+write+binary mode
fstream ff;
ff.open(filename, ios::in | ios:ut | ios::binary);
now this works
what i m looking for is, if the file does not exist, it should be created,
and i dont know what ios flag to use, the above statement will open the file
only if it already exist, for now what i m doing is chaek wether the file
already exist, if it does not exist then it opens file just for writing and
creates a zero byte file and then closes, then i m able to use above
statement for writing and reading from it, m i doing it right, any
suggestion ??
regards
i have been trying to open file using fstream, in read+write+binary mode
fstream ff;
ff.open(filename, ios::in | ios:ut | ios::binary);
now this works
what i m looking for is, if the file does not exist, it should be created,
and i dont know what ios flag to use, the above statement will open the file
only if it already exist, for now what i m doing is chaek wether the file
already exist, if it does not exist then it opens file just for writing and
creates a zero byte file and then closes, then i m able to use above
statement for writing and reading from it, m i doing it right, any
suggestion ??
regards