C++ ifstream to function -


(french, sorry 4 bad english) hi guys, have error when want send ifstream function.

function.cpp:

void solo(ifstream fichier) {     fichier("dico.txt"); } 

function.h

void solo(std::ifstream fichier); 

error

thank's !

you're attempting pass stream value, streams cannot copied. pass reference instead:

void solo(std::ifstream& fichier); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -