title: Can initialization `int * p = malloc(1000);` also be dealt in RAII style?
body: <p>What I understand from RAII is whenever you need to allocate memory manually with <code>new</code> etc. you need to free it too. So, instead of freeing it manually, you should create classes with constructor and destructor to do the job.</p>
  
  <p>So, what are the following people talking about?</p>
  
  <p>From: <a href="https://stackoverflow.com/questions/11015123/the-meaning-of-the-term-resource-acquisition-is-initialization#comment14400005_11015167">The meaning of the term - Resource Acquisition Is Initialization</a></p>
  
  <blockquote>
    <p>The problem is that int * p = malloc(1000); is also initialization of an (integer) object, but it's not the kind of initialization we mean in the context of RAII.
    ...</p>
    
    <p>@Fred: Indeed. int* is not a RAII type because it doesn't do cleanup. So it's not what RAII means, even though it is what RAII literally says.</p>
  </blockquote>
  
  <p>Well, I know <code>malloc</code> is used in C, and <code>new</code> is used in C++.</p>