If I have a header file in which I want to declare a class:
class Entity
{
int a;
int b;
void do_something();
};
Then this is just a normal declaration, right?
class Entity
{
int a = 0;
int b;
void do_something();
};
But now does this turn it into a definition? If it does, what exactly happens when I try to include that header file into two .cpp files? I'm basically going to have two Entity classes defined in two files but is this okay? If it is okay, then why is it okay? What exactly is the linker going to do?