gpt4 book ai didi

c - 在参数列表中声明的“struct”

转载 作者:行者123 更新时间:2023-11-30 20:46:24 25 4
gpt4 key购买 nike

这是我的头文件,它包含在另一个文件中但尚未使用:

#define ksm_read 0X01
#define ksm_rdwr 0x00

struct ksm_info_t {
uint ksmsz; //size of shared mem
int cpid; //pid of the creator
int mpid; //pid of the last modifier
uint attached_nr; //number of attached processes
uint atime; //last attached time
uint dtime; //last deattach time
uint total_shrg_nr; //total number of existing shared regions
uint total_shpg_nr; //total number of existing shared pages
};

int ksmget(char* name, uint size);
int ksmattach(int hd, int flag);
int ksmdetach(int hd);
int ksminfo(int hd, struct ksminfo_t* info);
int ksmdelete(int hd);

以下是我遇到的错误:

> ksm.h:18: error: ‘struct ksminfo_t’ declared inside parameter list
> ksm.h:18: error: its scope is only this definition or declaration, which is prob

最佳答案

拼写错误,应该是 struct ksm_info_t,而不是 struct ksminfo_t

关于c - 在参数列表中声明的“struct”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13647814/

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