The fact that it can produce a buffer overflow and that you do no checks to make sure it does not is enough to make it dangerous. Oversizing buffers is not a solution. It's a hack and a workaround.
...
Type: Posts; User: Elysia
The fact that it can produce a buffer overflow and that you do no checks to make sure it does not is enough to make it dangerous. Oversizing buffers is not a solution. It's a hack and a workaround.
...
The tutorial is garbage.
Besides, I would recommend you get a C++ GUI framework such as Qt instead of doing pure Win32 programming. It's easier and it's faster.
Some advice:
- Don't use new when...
main is not used in Windows programs.
Now that I think about it, why are you using operator new here? It seems superfluous. You should probably remove it.
You should, if possible, use std::string for all your strings, not char arrays.
Because it's static - there is only one instance of the variable in the program.