我有以下问题:
warning: implicit declaration of function ‘sendto’
在线变量outputCounterByte
:
outputCounterByte += sendto(server_socket, outputBuff, offSet, 0, (struct sockaddr*) remote_addr, server_addr_len);
我不太明白,问题出在哪里? OutputCouterByte 的值为 0,并且定义了其他变量。我已经包含了所有标题(函数原型(prototype))。 在其他功能中它正在工作。
最佳答案
您需要包含
#include <sys/types.h>
#include <sys/socket.h>
提供函数原型(prototype)。
关于c - 警告 : implicit declaration of function ‘sendto’ ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27620847/