Reputation:
(french, sorry 4 bad english) Hi guys, I have an error when I want send ifstream to my function.
function.cpp:
void solo(ifstream fichier)
{
fichier("dico.txt");
}
function.h
void solo(std::ifstream fichier);
Thank's !
Upvotes: 1
Views: 84
Reputation: 62113
You're attempting to pass the stream by value, but streams cannot be copied. Pass by reference instead:
void solo(std::ifstream& fichier);
Upvotes: 5