I am a student of class 12 having computer science as elective. I was making a test program using pointers. According to me it should display 5. But it is giving errors which I am unable to figure out why. Kindly help. I program on turbo c++ (I know it is too old but it is prescribed in our course).
Line 9 you are using the & operator on a int* pointer. This will give you a int** (pointer to pointer to int) but the type of ptr2 is different so you can't assign this value to it.