1 #include <stdlib.h>
2 #include <stdio.h>
3
4 class Test {
5 public:
6 int a, b, c, d;
7 };
8
operator new[](size_t size)9 void *operator new[](size_t size)
10 {
11 void *ret = malloc(size);
12 printf("Here.\n");
13 for (unsigned int i = 0; i < size; i++) ((char *) ret)[i] = 0xFF;
14 return ret;
15 }
16
main(int argc,char * argv[])17 int main(int argc, char *argv[]) {
18 Test *toto;
19 int i;
20 int j = 0;
21
22 toto = new Test[2];
23
24 for (i = 0; i < 2; i++) {
25 if (toto[i].a) {
26 j++;
27 }
28 //printf("%d : %08x %08x %08x %08x\n", i, toto[i].a, toto[i].b, toto[i].c, toto[i].d);
29 }
30 }
31