1.

Consider the following C++ program code to store address of an integer variable a into a pointer variable pint a = 5,*p; P = a; cout<< p; Identify the error in the above program segment and correct the error.

Answer»

P = a is the error because p is an integer pointer and can store only address. The correct code is p = &a;



Discussion

No Comment Found