adplus-dvertising
frame-decoration

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;
}

a.

Error: RValue required

b.

Error: Lvalue required

c.

Error: cannot convert from 'const int *' to 'int *const'

d.

No error

Answer: (d).No error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Point out the error in the program.