Home » C++ Programming » References » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    void print (char * str)
    {
    cout << str << endl;
    }
    int main ()
    {
    const char * str = "Interview Mania";
    print(const_cast (str) );
    return 0;
    }
    1. Interview
    2. Mania
    3. Interview Mania
    4. All of above
    5. None of these
Correct Option: C

In this program we used the concept of constant casting to cast the variable and printing it.



Your comments will be displayed only after manual approval.