在linux的头文件下有些结构体之间相互引用,这是如何去实现的

在linux的头文件下有些结构体之间相互引用,这是如何去实现的,第1张

可以借助指针互相引用,因为指针占用的内存是可知的:

struct a

{ int x, y

struct b *t

}

struct b

{

int p

struct a *q

}

int main()

{

struct a A

struct b B

return 0

}

#include "linux/config.h"

#include "linux/kernel.h"

#include "linux/module.h"

#include "linux/interrupt.h"

错了

正确的是和C一样的

如#include <linux/config>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8489533.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-17
下一篇 2023-04-17

发表评论

登录后才能评论

评论列表(0条)

保存