On Feb 19, 10:52 am, "hyderabadblues" <sirishku...@gmail.comwrote:
Following is an abstract of my code
Compiler is giving me an error at funciton call func1 as argument of
type void * is not compatible with parameter of type VP
typedef void * VP;
Here, you typedef the name VP to a pointer to void
struct name
{
int i;
};
void func1(VP* v)
Here, you say that func1 takes as it's argument a pointer to VP.
Since VP is typedefed as a pointer to void, this means that you've
made func1 require an argument of pointer to pointer to void.
{
}
void main()
Unless you are working in a freestanding implementation, main is
required to return an integer. This should be
int main(void)
{
struct name n1,*n2;
n2=&n1;
func1((void *)&n2); /////////////////
Here, you pass func1 an argument that is a pointer to void. Remember,
you defined func1() to require a pointer to pointer to void, so this
call to func1() has an argument mismatch with the definition.
Also, since main() returns an integer, good programming practice (and
certain backlevels of the C standard) requires that you return an
integer before falling off the end of main(). So
return 0;
}
HTH
--
Lew