View Full Version : C++ ifstream with a string

11-26-2004, 05: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?

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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum