#include <stdlib.h>
#include <memory>
#include <iostream>

int main()
{
  int* foo = (int*)malloc(sizeof(int) * 10);
  for (int i=0; i<10; i++)
    foo[i] = i;
  for (int i=0; i<10; i++)
    std::cout << foo[i];
  std::cout << std::endl;
  free(foo);

  std::unique_ptr<int[], std::default_delete<int[]> > bar(new int[10]);
  for (int i=0; i<10; i++)
    bar[i] = i;
  for (int i=0; i<10; i++)
    std::cout << bar[i];
  std::cout << std::endl;
}
