| | |
compiler error when address of a pointer is passed
![]() |
•
•
Join Date: Dec 2008
Posts: 10
Reputation:
Solved Threads: 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
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
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.
The most important thing in the Olympic Games is not to win but to take part, just as the most important thing in life is not the triumph but the struggle. The essential thing is not to have conquered but to have fought well.
-Pierre de Coubertin, The Olympic Creed Inspired by Bishop Ethelbert
-Pierre de Coubertin, The Olympic Creed Inspired by Bishop Ethelbert
![]() |
Similar Threads
- C++ to C# interop -- wrapper class? (C#)
- How to create a .lib from a .def? (C++)
- Searching for and deleting an element in vector (C++)
Other Threads in the C Forum
- Previous Thread: Dynamic char array - memory leak?
- Next Thread: C Function
Views: 487 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C
2darray api array arrays behaviour binary binarysearch c++ calculate char code coke command conversion convert copyimagefile creafecopyofanytypeoffileinc database decimal directory dude dynamic error exec factorial fflush(stdout) fgets file files fork forloop function functions getlasterror givemetehcodez grade graphics homework i/o input insert int integer lazy library line linked linkedlist linux list lists locate logical_drives loop loopinsideloop. malloc matrix memory motherboard mysql no-effort opensource operator output path pointer pointers problem process program programming questions read recursion recursive recv refresh reverse roman scanf scripting sms_speak socketprograming spoonfeeding string strings strtok structures student suggestions swap syntax system turbo-c turboc unix user variable windows words






