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

前端 未结 26 1184
南方客
南方客 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:40

    It has been a long time, but some things you never forget ;-).

    • forget the \0 at the end of a string.
    • allocate n characters for a string with n characters.
    • forgetting the break in a switch statement.
    • 'creative' macro use.

提交回复
热议问题