Thanks for everybody! Now I changed my logic. Since if I contain the same pointer point to itself it will create infinite loop. So for this revised one do I need to write the destructor?
#include <stdio.h>
#include <stdlib.h>
#include <tr1/array>
using namespace std;
class Graphnode {
public:
std::tr1::array<int, 16> state;
int x;
int depth;
Graphnode(std::tr1::array<int, 16>,int,int);
Graphnode();
//~Graphnode();
};
Graphnode::Graphnode()
{
int i=0;
for(i=0;i<16;i++)
{
state[i] = 0;
}
x = 0;
depth = 0;
}
Graphnode::Graphnode(std::tr1::array<int, 16> _state,int _x,int _d)
{
int i=0;
for(i=0;i<16;i++)
{
state[i] = _state[i];
}
x = _x;
depth = _d;
}
/*Graphnode::~Graphnode()
{
}*/