gpt4 book ai didi

c - 如何访问 struct 中的成员作为 double 数组和 struct 中成员的地址作为数组?

转载 作者:太空宇宙 更新时间:2023-11-03 23:49:11 25 4
gpt4 key购买 nike

<分区>

刚开始了解结构,尤其是涉及访问结构成员的地址或值。

我不确定我在这里使用的语言,但我有:

  1. 结构a的2x2矩阵
  2. struct x 是一个大小为 2 的数组
  3. 大小为 2 的结构 b 包含答案

到目前为止我已经...

&(*(b+i))->s = (*(*(a+i)+j)).s * (*(x+k)).s

但是我收到编译器错误

error: lvalue required as left operand of assignment

编辑:

我的结构

typedef struct num{
int s;
}num_t;

我的函数参数

 void calc(int n, int m, num_t **a, num_t *x, num_t *b)

此外,问题的措辞是否正确?

EDIT2:格式

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