淡疼的itoa和abs: 'itoa' was not declared in this scope; 'abs' was not declared in this scope

来源:互联网 发布:学java看什么书 编辑:程序博客网 时间:2024/04/30 12:34

       本来今天就被几个问题折腾得够呛, 结果下午写代码, g++又提示我:'itoa' was not declared in this scope,  尼玛, 我用itoa怎么啦? 后来发现:itoa函数不是ANSI(American National Standards Institute) C的标准, 应该避免使用这个函数.  OK, 是我糊涂了, 居然想着去用itoa这么危险恶心的非标准函数, 还是用snprintf吧。

       继续写代码, g++又提示我:'abs' was not declared in this scope, 尼玛, 绝对值函数都不让我用, 我可是加了#include<math.h>啊, 后来一查才知道, 应该加上#include <stdlib.h>, 好奇葩, 好吧, 不跟你计较了。


       



       


0 0