Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "list_funcs.h"
int main()
{
struct data_node *first = NULL, *new_node, *ptr = NULL;
insert(&first, 9);
char command;
char name [25];
int key;
int exit = 0;
while(!exit)
{
printf("\nEnter list command (+-flx):");
scanf("%c", &command);
switch(command)
{
case '+':
printf("+ detected\nEnter key data: ");
scanf("%d", &key);
printf("What string to store? ");
scanf("%s", name);
//ptr = insert(&first, key);
//strcpy(ptr->name, name);
//printf("%s", name);
break;
default:
break;
}
}
getchar();
}
[Linker error] undefined reference to `insert'
If i put the insert function within this file it doesnt throw that error.