July 24th, 2003, 04:43 PM
Unnamed Namespaces from MSDN
using namespace std;
std::string s1; // OK
string s2; // OK, `string` acts like `::string`
fstream f; // OK, `fstream` acts like `::fstream`
The above code from MSDN seems to work fine in my program, but when I try to use the .seekg it errors out.
inputFilename.open( infilename, ios::in); //fine
inputFilename.seekg (0, ios::end); //error
length = inputFilename.tellg();
It seems to accept the .open fstream feature, but not .seekg.
Any suggestions would be greatly appreciated. Thanks
July 24th, 2003, 09:06 PM
Because MSDN says that only the "istream" class has a method called "seekg" maybe?
July 25th, 2003, 09:26 AM
Agree with M.Hirsch
seekg belongs to istream. So I guess you could use # include <iostream>
July 25th, 2003, 11:19 AM