整数に動的にメモリ割り当て

#include < iostream >
using namespace std;

int main()
{
    int *p;
    
    p = new int(9);
    
    if(!p) {
        cout << "memory set error\n";
        return 1;
    }
    
    cout << "p set integer is: " << *p << "\n";
    
    delete p;
    
    return 0;
}