Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int *p;
6.
void *vp;
7.
if (vp == p);
8.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int *p;
6.
void *vp;
7.
if (vp == p);
8.
cout
Answer: Option A
Was this answer helpful ?
The void pointer is easily converted to any other type of pointer, so these are equal.
Output:
$ g++ poi4.cpp
$ a.out
equal
Was this answer helpful ?
Submit Solution