#include #include #include #define SIZE 100000 #define REPEAT 1000 #define TEST(x) s = clock(); for(int j = 0; j < REPEAT; j++) for(int i = 0; i < SIZE; i++) x[i] = x[0]+x[SIZE-1]+x[i/2]; e = clock(); printf("Time: %f\n", (float)(e-s) / (float)CLK_TCK); int *a; int b[SIZE+1]; void main (void) { a = new int[SIZE+1]; int *c = new int[SIZE+1]; int d[SIZE+1]; clock_t s,e; TEST(a); TEST(b); TEST(c); TEST(d); getch(); }