Home / C Programming / Const :: Discussion

Discussion :: Const

  1. Point out the error in the program.

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

  2. A.

    Error: Lvalue required

    B.

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

    C.

    No error and No output

    D.

    None of above

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment