G
Gnafu
(Hi to all... ^_^)
I tryed theese ways:
fstream riaperto( "codici.dat", ios:ut|ios::binary|ios::app);
if(riaperto.bad()){
cerr<<"errore di apertura"<<endl;
system("Pause");
}
riaperto.seekp(ios::beg);
riaperto.put(char(nbyte/256));
riaperto.put(char(nbyte%256));
^= This one writes the bytes at the end of the file (allright, it's the
"app") .
ofstream riaperto( "codici.dat", ios:ut|ios::binary);
if(riaperto.bad()){
cerr<<"errore di apertura"<<endl;
system("Pause");
}
riaperto.seekp(ios::beg);
riaperto.put(char(nbyte/256));
riaperto.put(char(nbyte%256));
This one it writes at the beginning but, then, the file contains only that
tow bytes... (overwrite)
What can i do?
Thanks in advance..
Gnafu
I tryed theese ways:
fstream riaperto( "codici.dat", ios:ut|ios::binary|ios::app);
if(riaperto.bad()){
cerr<<"errore di apertura"<<endl;
system("Pause");
}
riaperto.seekp(ios::beg);
riaperto.put(char(nbyte/256));
riaperto.put(char(nbyte%256));
^= This one writes the bytes at the end of the file (allright, it's the
"app") .
ofstream riaperto( "codici.dat", ios:ut|ios::binary);
if(riaperto.bad()){
cerr<<"errore di apertura"<<endl;
system("Pause");
}
riaperto.seekp(ios::beg);
riaperto.put(char(nbyte/256));
riaperto.put(char(nbyte%256));
This one it writes at the beginning but, then, the file contains only that
tow bytes... (overwrite)
What can i do?
Thanks in advance..
Gnafu