Attach a complete code:
#include
using namespace std;
The class Counted {
Private:
Int id;
Static int count;
Public:
Counted () : id (count++)
{
Cout<" The constructor is called. The Object id: "& lt;
~ Counted ()
{
Cout<" The destructor is called. The Object id: "& lt;
};
Int Counted: : count=0;
Int main (void)
{
Counted * p=new Counted;
The delete p;
Counted * t=new Counted [5];
}