потихоньку учу С. некомпилируется следующий код:
#include<stdio.h>
#include<stdlib.h>
typedef struct Abit Abit;
int initilize_base(Abit * abit);
struct Abit{
char name[10];
char facult[10];
Abit * next;
};
int main(void)
{
Abit * abit;
initialize_base(abit);
sprintf(abit->name,"olo");
sprintf(abit->facult,"olo");
printf("Name: > %s\nFacultet: > %s\n",abit->name, abit->facult);
return 0;
}
void initilize_base(Abit * abit)
{
abit = (Abit *)malloc(sizeof(Abit));
abit->next = NULL;
}
$ gcc -o lol lol.c
/tmp/ccQEwYB3.o: In function `main':
lol.c:(.text+0x11): undefined reference to `initialize_base'
collect2: ld returned 1 exit status