EDIT: Ah yes, the "crawww C is unsafe, use rust crawww!" downvote crowd is out in full force today.
EDIT: Ah yes, the "crawww C is unsafe, use rust crawww!" downvote crowd is out in full force today.
Unlearning bad C habits is hard because the language accommodates them for as long as you continue to cling to them. You need to consciously decide you will use the new, better way. Once you have done each once, there will be no temptation to backslide.
Heap allocated data is one special case of OS resources that can be managed by constructor/destructor pairs.
Learning C first is a very bad way to learn C++. One can pick up pointers later, and asm blocks after that.
It's like the "I know React but not JavaScript" crowd all over again.
RAII is about resource management, regardless of where those resources live on.
Heap allocated, OS handles, indexes on a fixed sized buffer, network sockets, ...
Again, what did being pedantic prove here? You clearly understood what I meant.
P.S. I haven't downvoted you.
Is C++20 support in compilers already? MSVC/GCC/Clang