constructors

Hello,
I am in an urgent need of help with this expression.
This is from a code that I have to work with:

PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* det):detector(det)

the second PrimaryGenaratorAction is a constructor from the class PrimaryGeneratorAction and it takes an argument which is pointer(det)to a method inside that class with the name of DetectorConstruction)

but after that :detector(det)

As I read in the inheritence part the name after : should be the name of a base class and the name beore it is the name of the derived class from that base class.
but detector(det) can't be a class name since it has started with small letters, otherwise the writing conventions should be differenet in this code from c++

Many thanks
The part after : in a constructor is called an initializer list. In it you can call the constructor of the parent class or the constructors of members. In this case detector is a member.
By the way, c++ doesn't enforce any naming conventions.
Topic archived. No new replies allowed.