#include #include #include int BoundsError(int d){ printf("You are trying to access memory that isn't yours.\n"); exit(1); } void BoundsCheck(int argc, void * start, ...){ va_list argptr; va_start(argptr, start); int index = 0; while (argc){ argc--; index = va_arg(argptr, int); if(index > *(int*)start){ BoundsError(index); } start += sizeof(int); } va_end(argptr); }