It really does not matter, as long as the .h is split from the .cpp .
It can also be a completely random name, even on a different drive.
The compiler will "match" them by the class's name.
First off, you can't have a class named class. class is a reserved word.
Not sure what you mean by "connected to each other".
You have to create an instance of (instantiate) the class.
Let's rename your class to Foo to avoid the use of a reserved word.
1 2 3 4 5 6 7
int main ()
{ Foo a; // this is an instance of Foo
// Its ctor will be called automatically to initialize it
a.somefunc(); // Call somefunc() which is a member of Foo.
// somefunc() will operate on instance a
return 0; // Foo's dtor is called to cleanup instance a
}
ty all
and AbstractionAnon change it to example.h if u want. doesnt matter it is just a name i used for my question. it is not like someone is going to create a class named class. thats so funny
and using the word "connected" at there is nonsense. i will change it.