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 detailed explanation :)
I currently have a Node class which i use to store the coordinates of points. Besides that, what i want to do with it is assign each different Node object an index number based on a counter. From what i gathered off the internet the way i do this is by using another class which initializes my counter in the constructor, and inside the Node class i just add it as a static parameter.
This is my code for the above:
class counter
{
public:
int nr;
counter()
{
nr = 0;
}
};
class Nod
{
static counter ctr;
public:
int index;
Punct pct;
Nod(Punct &temp)
{
pct = temp;
index = ctr.nr ++ ;
}
Nod() {}
};
Now, that builds ok, but as soon as i try to declare a Nod object inside my main function i get the following error: fatal error LNK1120: 1 unresolved externals and i've got absolutely no clue as to why this is. I've previously gotten this error when trying to write my own destructor but i got around that by just deleting that bit of code.
Thank you, and sorry if i'm using the wrong terminology for some of the things i've referred to.