gpt4 book ai didi

c++ - 错误: expected `,' or `...' before '.' token

转载 作者:太空宇宙 更新时间:2023-11-04 04:48:09 26 4
gpt4 key购买 nike

它在 intel/linux 64 位机器上编译得很好..

但是我需要进行此编译并在 SunOS 计算机上测试大/小端。但它没有编译。

Here is the Error:
util.h:48: error: expected `,' or `...' before '.' token

这是声明的标题部分@第 48 行:

 void addrFromHostname(const char* hostName, in_addr_t *s_addr);

这是该函数的CPP文件:

 void addrFromHostname(const char* hostName, in_addr_t *s_addr){
struct hostent *server;
server = gethostbyname(hostName);

if (server == NULL) {
fprintf(stderr,"ERROR, no such host as %s\n", hostName);
exit(0);
}

bcopy((char *)server->h_addr, (char *)s_addr, server->h_length);
}

最佳答案

该声明可能不正确。应该是:

void addrFromHostname(const char* , in_addr_t*);

检查一下。

关于c++ - 错误: expected `,' or `...' before '.' token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22177402/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com