Hi all,
I am doubtful about the void pointer type casting.
As per my understanding of 'C', when one typecasts a veriable, the temp variable gets created and the operations are done based on the temp variable formed. The original variable is unaffected.
For example : int i = 10; (float)i;
The above two statements keeps the variable "i" intact by forming the new temp variable of type mentioend in the typecast bracket. Please correct me if i am interpretting typecasting in a wrong way.
If my understanding about explicit type cast is correct then i wanted to know about void pointer type casting.
LPVOID ptr_void; OR void *ptr_void;
struct test {int i; float f;}test1;
ptr_void = &test1;
struct test *ptr_test = (struct test *)ptr_void;
I wanted to know if the temp variable formed will be pointer to the said structure or the structure variable itself ????
Thanks in advance...
sanjay
I am doubtful about the void pointer type casting.
As per my understanding of 'C', when one typecasts a veriable, the temp variable gets created and the operations are done based on the temp variable formed. The original variable is unaffected.
For example : int i = 10; (float)i;
The above two statements keeps the variable "i" intact by forming the new temp variable of type mentioend in the typecast bracket. Please correct me if i am interpretting typecasting in a wrong way.
If my understanding about explicit type cast is correct then i wanted to know about void pointer type casting.
LPVOID ptr_void; OR void *ptr_void;
struct test {int i; float f;}test1;
ptr_void = &test1;
struct test *ptr_test = (struct test *)ptr_void;
I wanted to know if the temp variable formed will be pointer to the said structure or the structure variable itself ????
Thanks in advance...
sanjay