If you've used some C, you know how sus the C strings are. And, data structure, C++ has classes (and structs). But the best thing of all, C++ has RAII. So, I can declare unique_ptr or shared_ptr and let the program allocate memory for me.
However, C++ will make the syntax look "less clear" also. If you're not too familiar with C in the first place, it may be best to stick with C. A lot of what C++ does, only makes sense when you know enough C. For example, unique_ptr and/or shared_ptr makes sense when you have suffered the pain of having to recursively traverse a binary tree to free every-single-node.
Leave comments down below to discuss through this.
If you've used some C, you know how sus the C strings are. And, data structure, C++ has classes (and structs). But the best thing of all, C++ has RAII. So, I can declare unique_ptr or shared_ptr and let the program allocate memory for me.
However, C++ will make the syntax look "less clear" also. If you're not too familiar with C in the first place, it may be best to stick with C. A lot of what C++ does, only makes sense when you know enough C. For example, unique_ptr and/or shared_ptr makes sense when you have suffered the pain of having to recursively traverse a binary tree to free every-single-node.
Leave comments down below to discuss through this.