![]() |
why do I get the error "conflicting types for..." ?
This is my code. The types are identical as far as I can see... If anyone could point out the error I'd be grateful. By the way I'm trying to implement a very simple singly-linked list. Any comments or suggestions would are kindly welcomed. Thanks!
Code:
#include <stdio.h>It says: "conflicting types for 'list_insert.' " Why?:( |
Re: why do I get the error "conflicting types for..." ?
Well, you have declared Structure Node inside the main method so the declaration is visible only to the main method.
Rest of teh compiler doesn't know what a node is, so in order to use this in all the functions of your program just declare it out side the main block....and your problem should be solved. |
Re: why do I get the error "conflicting types for..." ?
Also why is the prototype commented out? Without this the compiler will assume list_insert is defined
Code:
int list_insert(); |
| All times are GMT +5.5. The time now is 16:51. |