C++ programming problem
Link |
by Children of Lilith
on 2007-02-18 11:50:19
|
Whenever I try to pass a variable to a function, for instance: string filename; filename=[whatever]; ifstream filehandle(filename); I get an error saying strings can't be used in that function. std::system([whatever]) also gives me the same error. What am I missing here? |
Re: C++ programming problem
Link |
by
on 2007-02-18 13:09:14
|
the ifstream constructor does NOT take a std::string as a parameter! you MUST pass a char*! in order to get the char* representation of any std::string you can use the member function c_str() |