jweinst1
12/6/2018 - 5:14 PM

using malloc and free in cpp

using malloc and free in cpp

#include <iostream>
#include <cstdlib>




int main() {
  unsigned char* foo = reinterpret_cast<unsigned char*>(std::malloc(20));
  std::cout << (unsigned)(*foo) << '\n';
  std::free(foo);
}