Please don't put C and C++ in the same boat. This are two different languages and while C++ is definitely far from perfect, at least there is a lot of contruct to manage memory in a safer way (smart pointers raii) and usage of void pointers and c-like arrays are heavily discouraged.
Obliviously if you can use Rust, it's even better but that's not always the case.