Home » C++ Programming » Pointers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int *ptr;
    void *vptr;
    if (vptr == ptr)
    {
    cout << "Interview Mania";
    }
    return 0;
    }
    1. Interview Mania
    2. Compilation Error
    3. Runtime Error
    4. Garbage value
    5. None of these
Correct Option: A

The void pointer is easily converted to any other type of pointer, so these are equal.



Your comments will be displayed only after manual approval.