To start with i should probably let you know that i am by no means a programmer, and i\'m just doing this for a homework assignment, so if it\'s possible i will require a really
From the description of your problem ,the solution is far simpler.
You have complicated a simple issue, just use
class Nod
{
static int ctr;
public:
int index;
Nod()
{
ctr++; //Increment the counter every time a object is created
}
Nod() {}
};
//Allocate memory also
int Nod::ctr;
If there are more than 1 type of constructor, add the counter increment in every constructor.