#include <stdlib.h>
#include <iostream>
 
struct a
{
  virtual ~a(){};
  void* operator new[] (size_t s)
  {
    void* p = malloc(s);
    std::cout << "malloc returned " << p << std::endl;
    return p;
  }
 
  void operator delete[] (void* p)
  {
    std::cout << "delete[] got " << p << std::endl;
    free(p);
  }
};
 
struct b
{
  int x;
};
 
struct c: b, a
{
  int y;
};
 
int main ()
{
  c* cc = new c[10];
  std::cout << "new[] expression returned " << (void*)cc << std::endl;
  delete[] cc;
}