Pointers
- The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
int ***fun(float*, char**)
- What is the output of this program?
#include
using namespace std;
int main()
{
int p = 3, q = 5, r = 13;
int *array[ ] = {&p, &q, &r};
cout << array[1];
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
Array element cannot be address of auto variable. It can be address of static or extern variables.
- What will happen in this code?
int n = 50, m = 50;
int *ptr = &n, *ptr0 = &m;
ptr = ptr0;
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Assigning to reference changes the object to which the reference is bound.
- Which of the following is illegal?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
dp is initialized int value of i.
- Which one of the following is not a possible state for a pointer.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
A pointer can be in only 3 states a,b and c.