1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #include <string> #include <stdio.h> #include <iostream> #include <fstream> using namespace std; class FTestFile{ public: FTestFile() {} FTestFile(string file_path); const char* GetBuffer() const; private: ifstream stream; char buffer[1024]; }; FTestFile::FTestFile(string file_path) : stream(ifstream(file_path.c_str())) { memset(buffer, 0, 1024); stream.read(buffer, 1024); } const char* FTestFile::GetBuffer() const { return &buffer[0]; } int main(int argc, char** argv) { FTestFile f("D:/game_math/content/Testing_File.txt"); printf("%s\n", f.GetBuffer()); return 0; } |
x13pixelsVawx
Debugging main variable "f" causes hang indefinitely. I think it has to do with "ifstream".
Appreciate the test case. I'll get this taken care of.