ifstream f;
f.open(fileName);
if ( f.fail() )
{
// I need error message here, like "File not found" etc. -
// the reason of the failure
}
Comment obtenir un message d'erreur sous forme de chaîne?
cerr << "Error code: " << strerror(errno); // Get some info as to why
semble pertinent par rapport à la question.
strerror(errno)
marche. Postez ceci comme réponse, je l'accepterai.