ddesbuis
Messages postés17Date d'inscriptionlundi 16 août 2004StatutMembreDernière intervention21 juillet 2005 20 juil. 2005 à 07:39
ajoute
f.clear(); // le statut de f doit être <tt>eofbit car tu as atteint la fin du fichier</tt>
apres f.close() :
void clear ( iostate state = goodbit );
Set control states.
Sets a new value for the control state ignoring the existing value.
Parameters.
* state : An object of type <tt>ios_base::iostate</tt>
that can take as value any combination of the following state flag member
constants:
<li><tt>badbit </tt> (critical error in stream buffer)
</li><li><tt>eofbit </tt> (End-Of-File reached while extracting)
</li><li><tt>failbit</tt> (failure extracting from stream)
</li><li><tt>goodbit</tt> (no error condition, represents the absence of the above bits)
</li>
These are static member constants inherited from <tt>ios_base</tt>.
You may combine more than one state flag bitmask using the bitwise <tt>|</tt> (or) operator.
If this parameter is not specified, <tt>goodbit</tt> is assumed so any error state
is cleared.