blob: b3feb0c72687b655de71037f6f347b67a456bedc [file] [log] [blame]
sewardj30792602002-05-18 19:54:36 +00001#include <stdlib.h>
2#include <stdio.h>
3
4class Test {
5public:
6 int a, b, c, d;
7};
8
rjwalsh33606802004-04-13 19:11:27 +00009void *operator new[](size_t size)
sewardj30792602002-05-18 19:54:36 +000010{
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
17int 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 }
njn25e49d8e72002-09-23 09:36:25 +000028 //printf("%d : %08x %08x %08x %08x\n", i, toto[i].a, toto[i].b, toto[i].c, toto[i].d);
sewardj30792602002-05-18 19:54:36 +000029 }
30}