c++ class question (namespace/extra option)
Feb 22, 2016 at 9:54pm
Hi,
I read some code and I need help to understand.
1/
1 2
|
toto:Toto:Toto()
toto:Toto:~Toto()
|
The 1st name is namespace, the second one is class and the 3rd one is constructor/destructor. Right ?
2/
1 2
|
class toto_PUBLIC Toto
{
|
What is the signification of toto_PUBLIC ?
Thanks for help.
Feb 22, 2016 at 11:57pm
not sure about the first one.
The second toto_PUBLIC is a macro. usually a macro before the name of a class is used to mark the class as import/export for dll's.
Feb 23, 2016 at 1:19am
Hi,
1 2
|
toto:Toto:Toto()
toto:Toto:~Toto()
|
Should be :
1 2
|
toto::Toto::Toto()
toto::Toto::~Toto()
|
But that is a little crazy, normally one would do this:
1 2 3 4
|
namespace toto {
Toto::Toto(){}
Toto::~Toto(){}
} // end ns toto
|
The same for a class definition.
Topic archived. No new replies allowed.