Why would buffer overruns cause segmentation faults when accessing an integer?

前端 未结 5 1096
情书的邮戳
情书的邮戳 2021-01-19 09:39

During a call to function B() from function A(), B() allocates a 100-char array and fills it several times, including once with a 101-character string and once with a 110 ch

5条回答
  •  渐次进展
    2021-01-19 10:28

    If you're accessing i through a pointer, then the problem is the pointer is garbage.

提交回复
热议问题