can anybody tell me how to check if a file exists or not, while creating a new file, and if it does it displays "ALREADY EXISTS".
f1.open(fname,ios::noreplace);
if(!f1)
cout<<"CREATED";
else
cout<<"ALREADY EXISTS";
this is not correct, i think.
also hows' creatnew() in io.h diff from the above.