Identy the error in the following code segment int *ptr, m = 100; // line 1 cout << *ptr; //line 2
- Declaring ptr and m in one line is wrong
- In line 2, *ptr should be written as &ptr
- The address of m should be assigned to ptr before it is accessed
- No error
Answer:
Option c: The address of m should be assigned to ptr before it is accessed
Explanation Here
0 Comments