Creating a constructor

Joined
Apr 14, 2020
Messages
5
Reaction score
0
I hope this is a simple question. What does it mean when you add a : (something) onto a constructor? For instance:

C++:
class foo : public bar::ba::b //<- This  part (: public ...?)
{
    public:
        ...
}

does this just declare that the class has access to some public::ba::b?
 
Last edited:
Joined
Dec 10, 2020
Messages
10
Reaction score
1
Constructors are the same name as the class name then you need to make methods the same name as the class name.
example
class Devid{
Devid(){
// code here
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top