ifstream in("STLExtension.h",ios::ate); if (in.is_open()) { cout << "file length is " << in.tellg() << endl; }