I have an issue with the following code.
int main (int argc, const char * argv[]) { #define MAXCHARACTERS 10 #define MAXNUMBERS 2 char buffer[MAXCHARACTERS]; numberOfStructs = 0; allocSize = 10; array = malloc(allocSize * sizeof(StructItem)); dataLink *link; do { Album *tempStruct; fgets(&(*tempStruct->firstField),MAXCHARACTERS, stdin); fgets(&(*tempStruct->secondField), MAXCHARACTERS, stdin); fgets(buffer, MAXNUMBERS, stdin); sscanf(buffer, "%d", &(tempStruct->thirdField) == 1); // line 26 link = List(&tempStruct); array[numberOfStructs] = (*tempStructs); numberOfStructs += 1; array = reAllocArray(&array, &allocSize, numberOfstructs); } while(link->newStruct != NULL); printList(&array, numberOfStructs); freeArray(&array, numberOfStructs); } I get warnings as follows
/main.c:26: warning: comparison between pointer and integer warning: passing argument 1 of 'List' from incompatible pointer type
I get a few of the "passing argument 1" error messages.
What am I doing wrong with these pointers?
Thanks
Album? Or rather, how have you defined that type?