adplus-dvertising
frame-decoration

Question

Point out the error in the program.
#include<stdio.h>
const char *fun();

int main()
{
    *fun() = 'A';
    return 0;
}
const char *fun()
{
    return "Hello";
}

a.

Error: RValue required

b.

Error: Lvalue required

c.

Error: fun() returns a pointer const character which cannot be modified

d.

No error

Answer: (c).Error: fun() returns a pointer const character which cannot be modified

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.