I think this post describes the problem with a short humorous anecdote.
Why casting malloc is a bad idea...
Type: Posts; User: claudiu
I think this post describes the problem with a short humorous anecdote.
Why casting malloc is a bad idea...
If you want to compile in C++ you might as well drop all the "C-style" and write C++ code. Use strings instead of char arrays, use references in functions instead of passing pointers and allocate...
Stop spoon feeding solutions to newbies that provide no code.
Also, don't cast malloc.