adplus-dvertising
frame-decoration

Question

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

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

a.

Error: Lvalue required

b.

Error: cannot convert 'const char *' to 'char *'.

c.

No error and No output

d.

None of above

Posted under C Programming

Answer: (c).No error and No output

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.