相关疑难解决方法(0)

C空结构 - 这是什么意思/做什么?

我在一个头文件中找到了我需要使用的设备的代码,虽然我已经做了多年的C,但我从来没有遇到过:

struct device {
};

struct spi_device {
    struct device dev;
};
Run Code Online (Sandbox Code Playgroud)

它用作:

int spi_write_then_read(struct spi_device *spi, 
const unsigned char *txbuf, unsigned n_tx,
unsigned char *rxbuf, unsigned n_rx);
Run Code Online (Sandbox Code Playgroud)

还在这里:

struct spi_device *spi = phy->spi;
Run Code Online (Sandbox Code Playgroud)

在哪里定义相同.

我不确定这个定义的重点是什么.它位于主板的Linux应用程序的头文件中,但它对它的使用感到困惑.任何解释,想法?之前见过这个的人(我相信你们有些人:).

谢谢!:BP:

c struct

47
推荐指数
2
解决办法
1万
查看次数

标签 统计

c ×1

struct ×1