S
solartimba
Why can I open a file using a C-string but not a C++ string?
//C-strings works
char path[15];
strcpy(path,"c:\test.txt");
ifstream infile(path);
//C++ string class does not
string path("c:\test.txt");
ifstream infile(path);
Why? Is there something I can do to use a string (maybe a recast??)?
//C-strings works
char path[15];
strcpy(path,"c:\test.txt");
ifstream infile(path);
//C++ string class does not
string path("c:\test.txt");
ifstream infile(path);
Why? Is there something I can do to use a string (maybe a recast??)?