title: C++: Is it ever absolutely necessary to allocate memory manually?
body: <p>I'm relatively new to some of the more advanced aspects of C++ programming and I'm having some trouble understanding if it is ever truly necessary to allocate memory in C++ (whether it be through malloc, new, etc.). For example in C, I understand you need to allocate memory to have a dynamically sized array or other tasks. In C++, it seems to me that's not the case, you can just use a std::vector, std::string, or other built in methods which are already dynamically sized by design. I also understand that accessing allocated memory is slower vs the stack. </p>
  
  <p>So given that, are there times when you must allocate memory in C++, and if so, what is an example of one of those times? This of course does not include times when your C++ code must interact with a C program. Let's assume the program is written purely in C++.</p>
  
  <p>EDIT: To try to alleviate confusion, I understand that vectors and other structures are allocating their own memory, but that's something that happens behind the scenes and does not require the programmer to use new, malloc, etc. and it is cleaned up automatically. So what I'm really wondering is, is it ever necessary to perform memory management manually in C++</p>