gpt4 book ai didi

c - C 中的 Strcat() ...传递 `strcat' 的 arg 2 使指针来自整数而不进行强制转换

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

<分区>

这个函数 strcat() 有一个转换错误

   // split the block
for (i=0; block_size <= first_buddy_size/2; ++i) {
first_buddy_size/=2;
response[i] = strcat("F", itoa(first_buddy_size, buff, 10));
}
response[i] = strcat("A", itoa(block_size, buff, 10));

我得到的错误

buddy.c: In function `process_request':
buddy.c:49: warning: passing arg 2 of `strcat' makes pointer from integer without a cast
buddy.c:51: warning: passing arg 2 of `strcat' makes pointer from integer without a cast

我的声明

 block buddy_block[BUDDY_SIZE];
char* response[BUDDY_SIZE] = {0};
first_buddy_size = buddy_block[0].data;

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