Thread: c++ illegitimate seg. fault
so before run program like...
i typed free in terminal see how muce space have says...code:int main () { int a[400000]; int b[400000]; int c[400000]; int d[400000]; int e[400000]; //int f[400000]; system("free"); return 0; }
and program ( system("free"); ) returnscode:total used free shared buffers cached mem: 1018324 566952 451372 0 21348 238816 -/+ buffers/cache: 306788 711536 swap: 2980016 0 2980016
so should have enough free space for...code:total used free shared buffers cached mem: 1018324 566912 451412 0 21360 238760 -/+ buffers/cache: 306792 711532 swap: 2980016 0 2980016
but segmentation fault. ideas?code:int main () { int a[400000]; int b[400000]; int c[400000]; int d[400000]; int e[400000]; int f[400000]; system("free"); return 0; }
all large arrays define go on stack. maybe you're running out of stack space?
edit: see http://ubuntuforums.org/showthread.php?t=680535
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk c++ illegitimate seg. fault
Ubuntu
Comments
Post a Comment