What makes a C standard library function dangerous, and what is the alternative?

前端 未结 9 875
广开言路
广开言路 2020-12-04 06:05

While learning C I regularly come across resources which recommend that some functions (e.g. gets()) are never to be used, because they are either difficult or

9条回答
  •  既然无缘
    2020-12-04 06:44

    Any function that does not take a maximum length parameter and instead relies on an end-of- marker to be present (such as many 'string' handling functions).

    Any method that maintains state between calls.

提交回复
热议问题