Bonjour,
Voici mon problème, j'aimerais ouvrir un fichier dont le nom du fichier est contenu dans une variable string :
mais il me sort l'erreur "18 no matching function for call to `std::basic_ifstream<char, std::char_traits<char> >::basic_ifstream(std::string&)'"string temp;
temp="c:/test.dat";
ifstream file(temp);
alors que :
marche parfaitement.ifstream file("c:/test.dat");
J'aimerais savoir quelle est la différence entre les 2 codes et pourquoi le premier ne marche pas.
Merci beaucoup

 

 
		
		 
         
 

 
			
			

 
   


 string en argument
 string en argument
				 Répondre avec citation
  Répondre avec citation
Partager