弱弱的问下
把结构数组 传递给函数 程序代码:
#include<stdio.h> void vvv(struct persons *p); struct names { char firstname[20]; char middlename[20]; char lastname[20]; }; struct persons{ int number; struct names name; }; struct persons person[5] = { {302039823,{"Dribble","Mackede","Flossie"}}, {345345345,{"gadenfs","Kasdfas","Pszajkh"}}, {302039823,{"Kazsdfj","Aasdfaf","Mjasdfh"}}, {302039823,{"Qaadsef","ddghfhtty","Yjsjdsh"}}, {302039823,{"Bsdsdfs","Fsjdsdd","Rshdsdf"}} }; int main(void) { vvv(person); return 0; } void vvv(struct persons *p) { int i; for(i=0;i<5;i++) printf("%s, %s %c. -- %d\n",p[i].name.firstname, p[i].name.lastname, p[i].name.middlename[0], p[i].number); }
弱弱的问下哪里出错了