covid_list.c
//This function pops the first node of the list

This function pops the first node of the list
This function pops the first node of the list
char* pop(node_t **head_ref)
{
    char date[10];
    int cases;
    int deaths;
    char *return_buffer;
    return_buffer = (char*) malloc(sizeof(char) * 30);
	node_t *temp = *head_ref;
    if(*head_ref == NULL)
    {
        puts("List is empty");
        return;
    }
	*head_ref = (*head_ref)->next;
    strcpy(date, temp->date);
    cases = temp->cases;
    deaths = temp->deaths;
    sprintf(return_buffer, "%s %d %d\n", date, cases, deaths);
	return return_buffer;
}
char * pop ( node_t * * head_ref ) { char date [ 10 ] ; int cases ; int deaths ; char * return_buffer ; return_buffer = ( char * ) malloc ( sizeof ( char ) * 30 ) ; node_t * temp = * head_ref ; if ( * head_ref == NULL ) { puts ( " " ) ; return ; } * head_ref = ( * head_ref ) -> next ; strcpy ( date , temp -> date ) ; cases = temp -> cases ; deaths = temp -> deaths ; sprintf ( return_buffer , " \n " , date , cases , deaths ) ; return return_buffer ; }
This function pops the first node of the list
This function pops the first node of the list
//Check if head reference is NULL
 //This pops the node, most important part
