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

前端 未结 26 1176
南方客
南方客 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:41
    for(int i = 0; i<10; ++i)
      //code here
      //code added later
    

    Note that the later added code is not in the for loop.

    0 讨论(0)
  • 2021-02-03 13:41
    #include <string>
    

    Me thinking C supports string natively (using Metroworks codewarrior, about 8 years ago).

    I did this, for a final project of about 15,000 lines of code. I used this library to do everything relating to strings(appending, splitting, etc.) Only to have the TA's not able to compile any bit of my assignment(using GCC.)

    Little did i learn that metroworks had created their own string library. I failed that class.

    0 讨论(0)
提交回复
热议问题