Why do I get a segfault in C from declaring a large array on the stack?

Because your stack segment is smaller then 1820*285*5 ints. It’s usually in a neighborhood of 1MB.

Leave a Comment