结构体传参数(这个帖子介绍了关于structure和及struct arrary 作为参数 传递)
导读: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版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!