Home »
MCQs »
C++ MCQs
Which of the following is invalid?
134. Which of the following is invalid?
- string str, *ptr=0;
- int a, float *f = &a;
- int *ptr;
- None of the above
Answer: B) int a, float *f = &a;
Explanation:
The 2nd option is invalid because we are trying to initialize the address of the integer variable to a float pointer.