To solve the problem addresed by Moschops, why not use the std::string class, and then cin, or possibly even getline, since file names can have spaces in them.
(saisir le nom du fichier means enter file name in french...I think; it has been a long time since I have taken french lol.)
Secondly, you don't seem to be doing any actually reading of a file... @w@
Even if you were to fix the char pointer problem, you are still not really reading a file.
This code here:
1 2 3 4 5 6 7 8 9
|
ifstream fich;
fich.open(nom);
if(fich){
cout<<"good";
fich.close();
}
else
cout<<"bad";
}
|
Simply checks to see if the file exists, yet it does not actually READ.
If you want to read the file, then I suggest looping through each line, and inputting them into a container, such as another array, or better yet, a vector. I don't really know what you want though, maybe all you need to do is check to see if the file exists or not, lawl.