函数的返回值

扫码查看
- Emmanuel C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html C库: http://www.dinkumware.com/refxc.html 显然你的代码不符合原始规格。 你用湿面条判处30睫毛。 - Jerry Coffin in alcc ++It depends on your paranoid level...Note that ltoa() is not a standard C function.--EmmanuelThe C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.htmlThe C-library: http://www.dinkumware.com/refxc.html"Clearly your code does not meet the original spec.""You are sentenced to 30 lashes with a wet noodle."-- Jerry Coffin in a.l.c.c++ 没有名为''itoa'的标准函数,任何语法或语义 都是实现定义的。如果一个函数返回一个char *,它可以是 a中的任何一个指向(或进入)参数列表指定的缓冲区的指针, b)指向静态缓冲区的指针 c)指向动态分配缓冲区的指针。 d)错误指示(例如NULL) 如果情况(c)成立,那么丢弃返回值将导致 内存泄漏,你会觉得非常愚蠢。There is no standard function named ''itoa'' and any syntax or semanticsare implementation-defined. If a function returns a char *, that couldbe any ofa) a pointer to (or into) a buffer specified by the argument list,b) a pointer to a static bufferc) a pointer to a dynamically allocated buffer.d) an error indication (e.g. NULL)If case (c) holds, then discarding the return value will lead to amemory leak, and you will feel very silly. 这篇关于函数的返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-04 13:31
查看更多