That probably explains it. You're allocating 1111111111 pairs of 4-byte ints, that's 2,222,222,222 ints and of course 2,222,222,222*8 bytes (16.55GB), which is way over the maximum 3.2GB limit of 32-bit systems. If you want to write code like that, you're going to have to upgrade to 64-bit, or find some other way around it like using sparse arrays or a disk file.

If C were "nice", yes, you should get an "out of memory" error. But C isn't nice; it assumes you know what you're doing and only falls over when it really has to.