Which output of the following program is empty?

the following is the program source code:

class base{
    private:
        int x;
    public:
        void setx(int a) {x = a;}
        int getx() {return x;}
};

int main(){
    int * p;
    base a;
    a.setx(55);
    p = new int(a.getx());
    cout << *p;
}
CPP
Feb.28,2021

are you sure you compiled it? cout < < * p; you didn't even add a semicolon. In addition, have you added -sharpinclude < iostream > and using namepspace std; ? And CPP's main must be return an integer, not void .

I have tested the following code and output 55.

-sharpinclude <iostream>

using namespace std;

class base {
    private:
        int x;
    public:
        void setx(int a) {x = a;}
        int getx() {return x;}
};

int main() {
    int * p;
    base a;
    a.setx(55);
    p = new int(a.getx());
    cout << *p;
    return 0;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bda082-13706.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bda082-13706.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?