Not only that, but it's dangerous.
You will most likely double data on the last line, because it will try to read a new line, fail, and thus the previous data is left inside the buffer.
Yes, it...
Type: Posts; User: Elysia
Not only that, but it's dangerous.
You will most likely double data on the last line, because it will try to read a new line, fail, and thus the previous data is left inside the buffer.
Yes, it...
That's just the thing - it doesn't. The compiler doesn't care. It's more of a style thing. Bjarne had a question about that so I will link it: http://www.research.att.com/~bs/bs_faq2.html#whitespace...
NO!
This is undefined behavior!
Using pointers without allocating them
You should use std::string and call the c_str() member function to get the C-style string that the constructor expects.
...