Tuesday, January 12, 2021

Void pointer in c++

 


#include <iostream>
using namespace std;
int main()
{
    int a = 23;
    float b = 21;
    void *x = &a;
    void *y = &b;
    cout << "Address of a is " << x << endl;
    cout << "Address of b is " << y << endl;
    return 0;
}

No comments:

Post a Comment