Something in the while loop is giving me this error. I can't figure out what to look up because this error seems way to common to find out what to do with my specific example
#include <stdlib.h>
#include <stdio.h>
/*Structure declarations*/
struct Data {
int id_number;
float ratings;
};
typedef struct Node{
struct Data player;
struct Node *next;
}Node;
/*function declaration*/
void push(struct Node *list_head, int unique_id, float grade);
int main(){
/* Initialize list_head to Null since list is empty at first */
Node *list_head = NULL;
Node *traversalPtr;
push(list_head, 1, 4.0);
push(list_head, 2, 3.87);
push(list_head, 3, 3.60);
traversalPtr = list_head;
while(traversalPtr -> next != NULL){
printf("%d\n",traversalPtr -> player.id_number);
traversalPtr = traversalPtr -> next;
}
}
...function declarations
pushis not necessarily calling itself because the definition ofpushhas not been provided, just the declaration.push()to conclusively answer this. @CodakBlack, would it be possible to edit this into your question?