What was the most dangerous programming mistake you have made in C?

前端 未结 26 1788
南方客
南方客 2021-02-03 12:46

I am an intermediate C programmer. If you have made any coding mistake that you came to know later that it was the most hazardous / harmful to the total application please share

26条回答
  •  忘掉有多难
    2021-02-03 13:32

    One thing to look after are array bounds. If you go out of bounds, with bad luck you may end up overwriting memory that is used for other data.

    One nasty bug related to this was going out of bounds for a static array variable in a function. That ended up as a function changing values of the local variables of the calling function. That wasn't so straight-forward to debug..

提交回复
热议问题