[debutant] Instruction d'un bloc pas prise en compte
Bonjour a tous,
j'ai un probleme qui doit surement paraitre simple pour vous mais qui est completement incomprehensible pour moi:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| ifstream m_TestFichier("SemaineX.txt");
if (!m_TestFichier.is_open())
{
ofstream m_FichierTexte("SemaineX.txt");
}
else
{
ofstream m_FichierTexte("SemaineX.txt", ios_base::app );
}
m_TestFichier.close();
//ofstream m_FichierTexte("SemaineX.txt");
m_FichierTexte<<"Bonjour"<<endl; |
Le compilateur ( Visual c++ express ) me rapporte une erreur "identificateur non déclaré" pour m_FichierTexte a la derniere ligne. Par contre, il n'y a plus d'erreur si j'enleve le "//" devant l'avant derniere ligne. Je suis tres perplexe.
Merci beaucoup pour votre aide