Print? /*
* Copyright and version Declaration of the program
* Copyright (c) 2013, a student from the computer College of Yantai University
* All rightsreserved.
* File name: object. cpp
* Author: Yang shaoning
* Completion date: January 1, April 9, 2013
* Version: v1.0
* Input Description: None
* Problem description :.
* Program output :.
*/
# Include <iostream>
Using namespace std;
Class {
Private:
Int;
Public:
A () {a = 0 ;}
A (int aa): a (aa) {}// defines the constructor and initializes data member a with the aa parameter.
Int get () {return ;}
};
Int main (){
A * p; // defines the pointer object p of Class.
P = new A (6); // use p to point to A dynamic object and initialize it as an integer.
Cout <p-> get () <endl;
Return 0;
}
/*
* Copyright and version Declaration of the program
* Copyright (c) 2013, a student from the computer College of Yantai University
* All rightsreserved.
* File name: object. cpp
* Author: Yang shaoning
* Completion date: January 1, April 9, 2013
* Version: v1.0
* Input Description: None
* Problem description :.
* Program output :.
*/
# Include <iostream>
Using namespace std;
Class {
Private:
Int;
Public:
A () {a = 0 ;}
A (int aa): a (aa) {}// defines the constructor and initializes data member a with the aa parameter.
Int get () {return ;}
};
Int main (){
A * p; // defines the pointer object p of Class.
P = new A (6); // use p to point to A dynamic object and initialize it as an integer.
Cout <p-> get () <endl;
Return 0;
}
Result:
Feelings: Dynamic Object Creation