Negative sizeof
Posted November 12th, 2005 . No Comments .
It’s not that strange passing a negative value to an array but that the array size is negative is funny ![]()
#include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[]) { int size = -100; char array[size]; printf("Sizeof: %d\n", sizeof(array)); return 0; }
