What does this symbol mean?
AirlineTicket::AirlineTicket()
What does this symbol mean?
AirlineTicket::AirlineTicket()
On
AirlineTicket is like a namespace for your class. You have to use it in the implementation of the constructor.
On
In C++ the :: is called the Scope Resolution Operator. It makes it clear to which namespace or class a symbol belongs.
:: is the scope resolution operator - used to qualify names. In this case it is used to separate the class
AirlineTicketfrom the constructorAirlineTicket(), forming the qualified nameAirlineTicket::AirlineTicket()You use this whenever you need to be explicit with regards to what you're referring to. Some samples:
Now you have to use the scope resolution operator to refer to a specific bar.
::foo::baris a fully qualified name.::baris another fully qualified name. (::first means "global namespace")This uses scope resolution to select specific versions of foo.