gpt4 book ai didi

c - 错误 : expected ‘)’ before ‘;’ token

转载 作者:太空宇宙 更新时间:2023-11-04 00:21:36 25 4
gpt4 key购买 nike

<分区>

我有一个我无法解决的愚蠢的小问题......

exer3.c: In function ‘shm_pipe_pipe’:
exer3.c:69:39: error: expected ‘)’ before ‘;’ token
exer3.c:69:39: error: too few arguments to function ‘shmget’
/usr/include/i386-linux-gnu/sys/shm.h:54:12: note: declared here

第69行周边:

pipes_array[i].m_key = 1;
key = i;

pipes_array[i].m_shmid = shmget(key, PIPE_SIZE, IPC_CREAT | IPC_EXCL | 0600); //69

if (pipes_array[i].m_shmid < 0) {
perror("Error");
return -1;
}

然后:

exer3.c: In function ‘shm_pipe_read’:
exer3.c:111:60: error: expected ‘)’ before ‘;’ token

111线路周边:

    current_bytes_to_read = total_bytes_to_read <= pipes_array[i].m_bytes_in_pipe ? total_bytes_to_read : pipes_array[i].m_bytes_in_pipe;

//reading the information
if ((pipes_array[i].m_roffset + current_bytes_to_read) < PIPE_SIZE) { //111
memcpy(buf + offset, tbuffer + pipes_array[i].m_roffset, current_bytes_to_read);

然后: exer3.c:在函数“shm_pipe_write”中: exer3.c:153:41: error: expected ‘)’ before ‘;’ token

153行周边:

while (total_bytes_to_write != 0) {
if (pipes_array[i].m_bytes_in_pipe == PIPE_SIZE) { //153


make: *** [exer3.o] Error 1

有人可以帮我吗?谢谢!

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