Back | Reverse |

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 gendou 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()


Back | Reverse |

Copyright 2000-2024 Gendou | Terms of Use | Page loaded in 0.0020 seconds at 2024-04-28 09:49:13