Sail E0 Webinar
Question


Point out the error in the program.


#include<stdio.h>
int main()
{
const int k=7;
int *const q=&k;
printf("%d", *q);
return 0;
}
Options:
A .  Error: RValue required
B .  Error: Lvalue required
C .  Error: cannot CONVERT from 'const int *' to 'int *const'
D .  No error
Answer: Option D

No error. This will produce 7 as output.



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers