Possible Duplicate:
Dereferencing void pointers
I have a function call this way:
void foo(void *context) //function prototype
..
..
..
main()
{
.
.
foo(&(ptr->block)); //where ptr->block is of type integer.
.
.
.
void foo(void *context)
{
Here I try to use the ptr->block but am having problems. I have tried
if((int *)context ==1)
..
..
}
I am typecasting it back to int in the function to use it. Am I dereferencing it wrong inside the foo() function?