Why do I declare that the large array in the stack will have a paragraph error?

I got a segfault from this line of code:

int fatblob[1820][286][5 ];

Why is this?

You are trying to allocate 1820 * 285 * 5 * sizeof(int)bytes = about 10MB (if sizeof (int)== 4). This may allocate more bytes than the stack provided by your operating system by default, so you get a stack overflow/segmentation fault.

You can pass in When creating a thread, request additional stack, allocate on the heap or change the default value of the operating system to solve this problem.

I got a segfault from this line of code: < p>

int fatblob[1820][286][5];

Why is this?

You are trying to allocate 1820 * 285 * 5 * sizeof(int)bytes = about 10MB (if sizeof(int) == 4). This may be better than you The default stack provided by the operating system allocates more bytes, so you get a stack overflow/segmentation fault.

You can allocate on the heap by requesting additional stack when creating a thread or Change the default value of the operating system to solve this problem.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2201 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.