Home » C++ Programming » Pointers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int fun(void *P);
    int main()
    {
    char *S = "Interview Mania";
    fun(S);
    return 0;
    }
    int fun(void *P)
    {
    cout << P;
    return 0;
    }
    1. Address of sting "Interview Mania"
    2. Compilation Error
    3. Runtime Error
    4. Garbage Value
    5. Interview Mania
Correct Option: A

Even though it is a void pointer, we gets the address.



Your comments will be displayed only after manual approval.