首页IT科技结构体传参数(这个帖子介绍了关于structure和及struct arrary 作为参数 传递)

结构体传参数(这个帖子介绍了关于structure和及struct arrary 作为参数 传递)

时间2025-05-01 18:31:32分类IT科技浏览3254
导读:Hi there.....

Hi there..

My name is Frank Münnich. Ive got a question about pointers that

refer to an array of a structure.

How do I declare that type?

If I have declared a structure

struct mystruc {

int x,y,z;

char a,b,c;

};

and have furthermore declared

mystruc data[20];

and now I would like to have a pointer that refers to the array of

structures, how do I do this?

mystruc *mypointer[20] declares an array of 20 pointers, not a pointer

referring to an array of 20 structures.

I need this in order to pass the whole structure as a parameter in a

function, so that the function can alter the data in the field.

If anyone could help, it would be HIGHLY appreciated.

Sincerely yours,

Frank Münnich / TU Dresden

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
XLAT指令中使用了一种特殊的基址变址寻址方式(xlsclients命令 – 列出应用程序) kali攻击方式(使用Kalibr标定相机和IMU(ZED+px4)外参)