+ 1
How to convert type of pointer by using type casting?
3 Answers
0
May I refer you to the question "what is type casting"? It is answered there already. Pls let me know, if you want something to be added to the answer.
0
eg:
long * a = new long(6);//0x00000006
int *p=NULL;
p= (int *) a;// points to first 4 bit
value of *p will be 0; aa it takes msb 32 bits
int *q = ++p; // points to next 4 bit
so value. of *q is 6.
so u can see how we can do it and the risks involved in it.
- 1
* and & both are opposite to each other