Interview Question 3590
Created by admin on Sat, 17/11/2012 - 14:08
Explanation:
Pointers are different from references. One of the main differences is that the pointers can be both initialized and assigned,whereas references can only be initialized. So this code issues an error.
Question:
void main()
{
int a, *pa, &ra;
pa = &a;
ra = a;
cout <<"a="<
<<"> }
Language:
Answer:
Compiler Error: 'ra',reference must be initialized