i use Code::blocks to compile my C++ programs how ever in this program of mine the Data File Codes does not seem to work. There must be a bug that i can't find.
The bugs are commented in the code (line 206 , 251)
If there is already a newline character in the input buffer when you get to line 251, then control will fall right through. Look at whatever is getting input BEFORE that and make sure you're consuming any newline characters.
It compiles cleanly and execution creates an 8-byte data file. There is no "Hello" within those 8 bytes. An edit of Foo::Foo() to initalize Foo::gaz with "Hello world!" still creates an 8-byte file. I could write an entire novel into gaz and it would not change the size of Foo one bit.
Think about this: Where does std::string put the text that it holds?