Has anyone used CodeBlocks (MingW plugins) here? I can't seem to use the alloc.h library. When I try to compile my code, the compiler can't seem to find the alloc.h...
1 2 3 4 5 6
\Desktop\Proj\LinkedList\main.c|4|error: alloc.h: No such file or directory|
\Desktop\Proj\LinkedList\main.c||In function 'insertData':|
\Desktop\Proj\LinkedList\main.c|84|warning: incompatible implicit declaration of built-in function 'malloc'|
\Desktop\Proj\LinkedList\main.c||In function 'delete':|
\Desktop\Proj\LinkedList\main.c|114|warning: incompatible implicit declaration of built-in function 'free'|
||=== Build finished: 1 errors, 2 warnings ===|
I tried compiling the code using Turbo C (in DOSBox), and at first it was sending out a "Declaration not allowed here error":
1 2 3 4 5 6 7 8 9 10 11 12 13
void save() {
int i;
LIST *p;
p = L;
FILE *fp;
fp = fopen("/mit594.dbf", "w+");
while (p != NULL) {
fprintf(fp,"%d\n",L->x);
p=p->next;
}
fclose(fp);
}
I tried moving the FILE *fp line to the first line in the code and it worked. Can someone explain to me why this happened?