Invalid type argument of -> C structs

后端 未结 2 1428
小鲜肉
小鲜肉 2020-12-05 13:07

I am trying to access items in an array of structs and print the structs fields as follows

printList(Album *a, int numOfStructs)
{
    int i;
    int j;

            


        
2条回答
  •  情歌与酒
    2020-12-05 13:49

    a is of type Album* which means that a[i] is of type Album (it is the ith element in the array of Album object pointed to by a).

    The left operand of -> must be a pointer; the . operator is used if it is not a pointer.

提交回复
热议问题