Even after casting a void pointer, I am getting compilation error while dereferencing it. Could anyone please let me know the reason of this.
int lVNum = 2;
A void pointer is just that, a pointer to a void (nothing definable).
Useful in some instances. For example malloc() returns a void pointer precisely because it allocated memory for an UNDEFINED purpose. Some functions may likewise take void pointers as arguments because they don't care about the actual content other than a location.
To be honest, the snippet you posted makes absolutely no sense, can't even guess what you were trying to do.