ifstream f;
f.open(fileName);
if ( f.fail() )
{
// I need error message here, like "File not found" etc. -
// the reason of the failure
}
Come ottenere un messaggio di errore come stringa?
cerr << "Error code: " << strerror(errno); // Get some info as to why
sembra pertinente alla domanda.
strerror(errno)
funziona. Pubblica questo come risposta, lo accetterò.