Once you learn to use classes you will understand the problems that malloc/free will cause, mostly: Non-initialized variables and Memory Leaks everywhere.
Are you saying EssGeEich that the proper use of malloc() and free() on only non - class types like ints and char pointers will cause this? I can't say I've ever heard that before. If your point is though that one should not attempt to use these C Runtime functions on C++ classes I'd agree with that. Just asking???
Not exactly on built-in variables, but on classes, most times (if not all) you will suffer from memory leaks and uninitialized variables (thus eventual bad memory access) if you use something like std::string or std::vector or std::list.
Their presence in a class allocated with new is correct.
If their class is allocated with malloc, they will fail 99% of times.
But it's better to begin to get used to write new/delete instead of malloc/free even with builtin variables. Being consistent is a good thing.
+1 @ kbw. malloc/free have no place in C++, unless you're handing off ownership of allocated memory to a C library (in which case I recommend finding a library that doesn't require passing ownership of memory back and forth).
C++ provides language support for a number of really useful constructs. The language can guarantee initialisation/cleanup of abstract data types, do deep copies of complicated data structures, you can create your own types that are first class types and integrate with I/O, other types ... pretty much all the stuff the I longed for in C, but needed practices to make sure they were done.
C++ can help you, but it has ways of doing things, and you need to appreciate how it does it's thing to really use it effectively. In the end, you're just helping yourself and your users.