Question from the C++ test

What is the value of p1 and q1 in the following code? ```c++ int i = 0; int *p = &i; int *const p1 = &i; int *const q1 = &*p; ```

Expert

How would the compiler interpret variables p1 and q1 in the following code?

int i = 1;
int &p1 = i;
int &q1 = p1;
Author: Abha AgrawaStatus: PublishedQuestion passed 449 times
Edit
0
Community Evaluations
developer avatar
Incorrect answer
Auteur anonyme
11/01/2024
p is undefined so its not valid
developer avatar
Fafun
02/03/2024
I guess typo errors 'p' instead of 'p1'