How to convert type of pointer by using type casting? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to convert type of pointer by using type casting?

20th Jun 2016, 8:23 PM
Waleed Ali
Waleed Ali - avatar
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.
20th Jun 2016, 9:34 PM
Stefan
Stefan - avatar
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.
21st Oct 2016, 9:31 PM
PANKAJ KUMAR
PANKAJ KUMAR - avatar
- 1
* and & both are opposite to each other
20th Jun 2016, 8:57 PM
Waleed Ali
Waleed Ali - avatar