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

前端 未结 9 886
广开言路
广开言路 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:49

    strtok() is generally considered to be evil because it stores state information between calls. Don't try running THAT in a multithreaded environment!

提交回复
热议问题