Name: Anonymous 2013-05-27 19:58
Please critique my code.
/****************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef unsigned long long SUPER_INTEGER;
int main(int argc, char* argv[])
{
SUPER_INTEGER Counter = 0;
time_t Current = time(0);
SUPER_INTEGER *Epochs = (SUPER_INTEGER*)malloc(sizeof(SUPER_INTEGER)*64);
time_t *times = (time_t*)malloc(sizeof(time_t)*64);
for(int i = 64;i < 65;i++) Epochs[i] = 0;
for(int i = 64;i < 65;i++) times[i] = 0;
Epochs[0] = 1;
for(int i = 1; i < 64; i++)
{
Epochs[i] = (Epochs[i-1] << 1);
}
SUPER_INTEGER Test = 0;
while(1==1)
{
Counter++;
for(int i = 0; i < 64; i++)
{
Test = Counter ^ Epochs[i];
if(!Test) printf("\nReached 2^%d (=%llu), about %llu seconds after starting!",i,Epochs[i],time(0)-Current);
}
Test = Counter ^ Epochs[63];
if(!Test) break;
}
return 0;
}