0

Hi all,
I am getting a compiler error for the following:


The following is the declaration in the header:
void init(INBUFF ** , OUTBUFF ** ); ---->line no 21

The following is the function init:
void init(INBUFF ** inbuffptr, OUTBUFF ** outbuffptr)
{ ------------------->line no 81
*inbuffptr = (INBUFF *) malloc(sizeof(INBUFF));
*outbuffptr = (OUTBUFF *) malloc(sizeof(OUTBUFF));
(*inbuffptr)->begin = (*inbuffptr)->end = (*inbuffptr)->next = NULL;
(*outbuffptr)->begin = (*outbuffptr)->end = NULL;
}

This function is invoked by the following code snippet:
INBUFF * inbuff1 = NULL;
OUTBUFF * outbuff1 = NULL;
init(&inbuff1, &outbuff1);


The error that I get when i compile is:

Icore.c:81: error: conflicting types for âinitâ
Iheader.h:21: error: previous declaration of âinitâ was here


Could any one please tell why this compiler error is being generated?

Thanks,
Prashanth

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by me_ansh
0

Might be a missing semicolon previous to line 81 in the *.cpp file, or missing header file, or missing declaration of INBUFF and OUTBUFF, or a host of other things.

0

As per the data provided by you, everything seems fine so please post the complete code in flow....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.