Sail E0 Webinar
Question


What will be output of this function?


1.
int main()
2.
{
3.
register int i = 1;
4.
int *ptr = &i;
5.
cout
Options:
A .  0
B .  1
C .  Compiler error may be possible
D .  Runtime error may be possible
Answer: Option C

Using & on a register variable may be invalid, since the compiler may store the variable in a register, and 

finding the address of it is illegal.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers