...

View Full Version : C++ ifstream with a string



ghell
11-26-2004, 06:18 PM
i can use
ifstream myFile("test.txt");
but not
string str = "test.txt";
ifstream myFile(str);


im trying to use a function so i sorta need it to get it from a vairable, is there any way to do this?

maes
11-26-2004, 10:22 PM
try ifstream myFile(str.c_str());



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum