您的位置:首页 > 其它

函数调用注意声明原型

2014-06-03 21:23 344 查看
When you compile your program that uses a dynamic library, object files are left with references to the library functions just as for any other external reference.

You need to include the header for the library so that the compiler knows the specific types of the functions you are calling. Note the compiler only needs to know
the types associated with a function (such as, it takes an int and returns a char *) so that it can correctly allocate space for the function call.

大致的意思就是说,是使用函数的时候,需要声明原型(#include相应的头文件;或者extern)。这有助于编译器生成相应的正确代码。否则,函数调用关系时产生的代码可能有错误。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c compiler