What does the “::” mean in C++?2019 Community Moderator ElectionThe Definitive C++ Book Guide and ListWhy are begin(container) and end(container) accessible everywhere but aren't in global namespace?What are the differences between a pointer variable and a reference variable in C++?What does the explicit keyword mean?What are POD types in C++?The Definitive C++ Book Guide and ListWhat is the effect of extern “C” in C++?What is the “-->” operator in C++?What is the copy-and-swap idiom?What is The Rule of Three?C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?Why is it faster to process a sorted array than an unsorted array?

Vocabulary for giving just numbers, not a full answer

Does a difference of tense count as a difference of meaning in a minimal pair?

What is better: yes / no radio, or simple checkbox?

PTIJ: Why does only a Shor Tam ask at the Seder, and not a Shor Mu'ad?

Doesn't allowing a user mode program to access kernel space memory and execute the IN and OUT instructions defeat the purpose of having CPU modes?

Are all players supposed to be able to see each others' character sheets?

Why restrict private health insurance?

Doubts in understanding some concepts of potential energy

Are small insurances worth it?

Virginia employer terminated employee and wants signing bonus returned

Was it really inappropriate to write a pull request for the company I interviewed with?

I reported the illegal activity of my boss to his boss. My boss found out. Now I am being punished. What should I do?

Is a piano played in the same way as a harmonium?

What materials can be used to make a humanoid skin warm?

How do we create new idioms and use them in a novel?

What is Tony Stark injecting into himself in Iron Man 3?

What would be the most expensive material to an intergalactic society?

Street obstacles in New Zealand

Is it possible that a question has only two answers?

Power Strip for Europe

Is it safe to abruptly remove Arduino power?

Does "Until when" sound natural for native speakers?

Why is there an extra space when I type "ls" in the Desktop directory?

Having the player face themselves after the mid-game



What does the “::” mean in C++?



2019 Community Moderator ElectionThe Definitive C++ Book Guide and ListWhy are begin(container) and end(container) accessible everywhere but aren't in global namespace?What are the differences between a pointer variable and a reference variable in C++?What does the explicit keyword mean?What are POD types in C++?The Definitive C++ Book Guide and ListWhat is the effect of extern “C” in C++?What is the “-->” operator in C++?What is the copy-and-swap idiom?What is The Rule of Three?C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?Why is it faster to process a sorted array than an unsorted array?










9















What does this symbol mean?



AirlineTicket::AirlineTicket()









share|improve this question



















  • 6





    The fact that you're asking the question suggests that you have not yet read a basic introductory book on C++ - you should probably make it a priority to do so before you get much further with learning the language.

    – Paul R
    Mar 17 '11 at 21:38






  • 2





    @Paul R: Exactly. Here's the book list: stackoverflow.com/questions/388242/…

    – Fred Larson
    Mar 17 '11 at 21:42











  • thanks @Fred Larson

    – Milad Sobhkhiz
    Mar 17 '11 at 21:47






  • 2





    @PaulR Not everyone who arrives upon this question is looking to learn C++. I, for example, just happened to be skimming some C++ code and wanted to get the general idea of what the program is doing and needed a quick reference :)

    – Ebony Maw
    Dec 16 '18 at 18:34















9















What does this symbol mean?



AirlineTicket::AirlineTicket()









share|improve this question



















  • 6





    The fact that you're asking the question suggests that you have not yet read a basic introductory book on C++ - you should probably make it a priority to do so before you get much further with learning the language.

    – Paul R
    Mar 17 '11 at 21:38






  • 2





    @Paul R: Exactly. Here's the book list: stackoverflow.com/questions/388242/…

    – Fred Larson
    Mar 17 '11 at 21:42











  • thanks @Fred Larson

    – Milad Sobhkhiz
    Mar 17 '11 at 21:47






  • 2





    @PaulR Not everyone who arrives upon this question is looking to learn C++. I, for example, just happened to be skimming some C++ code and wanted to get the general idea of what the program is doing and needed a quick reference :)

    – Ebony Maw
    Dec 16 '18 at 18:34













9












9








9


1






What does this symbol mean?



AirlineTicket::AirlineTicket()









share|improve this question
















What does this symbol mean?



AirlineTicket::AirlineTicket()






c++






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 8 '17 at 12:11









Mateusz Piotrowski

3,95063152




3,95063152










asked Mar 17 '11 at 21:33









Milad SobhkhizMilad Sobhkhiz

3994723




3994723







  • 6





    The fact that you're asking the question suggests that you have not yet read a basic introductory book on C++ - you should probably make it a priority to do so before you get much further with learning the language.

    – Paul R
    Mar 17 '11 at 21:38






  • 2





    @Paul R: Exactly. Here's the book list: stackoverflow.com/questions/388242/…

    – Fred Larson
    Mar 17 '11 at 21:42











  • thanks @Fred Larson

    – Milad Sobhkhiz
    Mar 17 '11 at 21:47






  • 2





    @PaulR Not everyone who arrives upon this question is looking to learn C++. I, for example, just happened to be skimming some C++ code and wanted to get the general idea of what the program is doing and needed a quick reference :)

    – Ebony Maw
    Dec 16 '18 at 18:34












  • 6





    The fact that you're asking the question suggests that you have not yet read a basic introductory book on C++ - you should probably make it a priority to do so before you get much further with learning the language.

    – Paul R
    Mar 17 '11 at 21:38






  • 2





    @Paul R: Exactly. Here's the book list: stackoverflow.com/questions/388242/…

    – Fred Larson
    Mar 17 '11 at 21:42











  • thanks @Fred Larson

    – Milad Sobhkhiz
    Mar 17 '11 at 21:47






  • 2





    @PaulR Not everyone who arrives upon this question is looking to learn C++. I, for example, just happened to be skimming some C++ code and wanted to get the general idea of what the program is doing and needed a quick reference :)

    – Ebony Maw
    Dec 16 '18 at 18:34







6




6





The fact that you're asking the question suggests that you have not yet read a basic introductory book on C++ - you should probably make it a priority to do so before you get much further with learning the language.

– Paul R
Mar 17 '11 at 21:38





The fact that you're asking the question suggests that you have not yet read a basic introductory book on C++ - you should probably make it a priority to do so before you get much further with learning the language.

– Paul R
Mar 17 '11 at 21:38




2




2





@Paul R: Exactly. Here's the book list: stackoverflow.com/questions/388242/…

– Fred Larson
Mar 17 '11 at 21:42





@Paul R: Exactly. Here's the book list: stackoverflow.com/questions/388242/…

– Fred Larson
Mar 17 '11 at 21:42













thanks @Fred Larson

– Milad Sobhkhiz
Mar 17 '11 at 21:47





thanks @Fred Larson

– Milad Sobhkhiz
Mar 17 '11 at 21:47




2




2





@PaulR Not everyone who arrives upon this question is looking to learn C++. I, for example, just happened to be skimming some C++ code and wanted to get the general idea of what the program is doing and needed a quick reference :)

– Ebony Maw
Dec 16 '18 at 18:34





@PaulR Not everyone who arrives upon this question is looking to learn C++. I, for example, just happened to be skimming some C++ code and wanted to get the general idea of what the program is doing and needed a quick reference :)

– Ebony Maw
Dec 16 '18 at 18:34












4 Answers
4






active

oldest

votes


















29














:: is the scope resolution operator - used to qualify names. In this case it is used to separate the class AirlineTicket from the constructor AirlineTicket(), forming the qualified name AirlineTicket::AirlineTicket()



You use this whenever you need to be explicit with regards to what you're referring to. Some samples:



namespace foo 
class bar;

class bar;
using namespace foo;


Now you have to use the scope resolution operator to refer to a specific bar.



::foo::bar is a fully qualified name.



::bar is another fully qualified name. (:: first means "global namespace")



struct Base 
void foo();
;
struct Derived : Base
void foo();
void bar()
Derived::foo();
Base::foo();

;


This uses scope resolution to select specific versions of foo.






share|improve this answer
































    2














    In C++ the :: is called the Scope Resolution Operator. It makes it clear to which namespace or class a symbol belongs.






    share|improve this answer






























      1














      It declares a namespace. So in AirlineTicket:: you can call all public functions of the AirlineTicket class and AirlineTicket() is the function in that namespace (in this case the constructor).






      share|improve this answer






























        0














        AirlineTicket is like a namespace for your class. You have to use it in the implementation of the constructor.






        share|improve this answer






















          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f5345527%2fwhat-does-the-mean-in-c%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          29














          :: is the scope resolution operator - used to qualify names. In this case it is used to separate the class AirlineTicket from the constructor AirlineTicket(), forming the qualified name AirlineTicket::AirlineTicket()



          You use this whenever you need to be explicit with regards to what you're referring to. Some samples:



          namespace foo 
          class bar;

          class bar;
          using namespace foo;


          Now you have to use the scope resolution operator to refer to a specific bar.



          ::foo::bar is a fully qualified name.



          ::bar is another fully qualified name. (:: first means "global namespace")



          struct Base 
          void foo();
          ;
          struct Derived : Base
          void foo();
          void bar()
          Derived::foo();
          Base::foo();

          ;


          This uses scope resolution to select specific versions of foo.






          share|improve this answer





























            29














            :: is the scope resolution operator - used to qualify names. In this case it is used to separate the class AirlineTicket from the constructor AirlineTicket(), forming the qualified name AirlineTicket::AirlineTicket()



            You use this whenever you need to be explicit with regards to what you're referring to. Some samples:



            namespace foo 
            class bar;

            class bar;
            using namespace foo;


            Now you have to use the scope resolution operator to refer to a specific bar.



            ::foo::bar is a fully qualified name.



            ::bar is another fully qualified name. (:: first means "global namespace")



            struct Base 
            void foo();
            ;
            struct Derived : Base
            void foo();
            void bar()
            Derived::foo();
            Base::foo();

            ;


            This uses scope resolution to select specific versions of foo.






            share|improve this answer



























              29












              29








              29







              :: is the scope resolution operator - used to qualify names. In this case it is used to separate the class AirlineTicket from the constructor AirlineTicket(), forming the qualified name AirlineTicket::AirlineTicket()



              You use this whenever you need to be explicit with regards to what you're referring to. Some samples:



              namespace foo 
              class bar;

              class bar;
              using namespace foo;


              Now you have to use the scope resolution operator to refer to a specific bar.



              ::foo::bar is a fully qualified name.



              ::bar is another fully qualified name. (:: first means "global namespace")



              struct Base 
              void foo();
              ;
              struct Derived : Base
              void foo();
              void bar()
              Derived::foo();
              Base::foo();

              ;


              This uses scope resolution to select specific versions of foo.






              share|improve this answer















              :: is the scope resolution operator - used to qualify names. In this case it is used to separate the class AirlineTicket from the constructor AirlineTicket(), forming the qualified name AirlineTicket::AirlineTicket()



              You use this whenever you need to be explicit with regards to what you're referring to. Some samples:



              namespace foo 
              class bar;

              class bar;
              using namespace foo;


              Now you have to use the scope resolution operator to refer to a specific bar.



              ::foo::bar is a fully qualified name.



              ::bar is another fully qualified name. (:: first means "global namespace")



              struct Base 
              void foo();
              ;
              struct Derived : Base
              void foo();
              void bar()
              Derived::foo();
              Base::foo();

              ;


              This uses scope resolution to select specific versions of foo.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Mar 17 '11 at 21:40

























              answered Mar 17 '11 at 21:35









              ErikErik

              67.8k9173174




              67.8k9173174























                  2














                  In C++ the :: is called the Scope Resolution Operator. It makes it clear to which namespace or class a symbol belongs.






                  share|improve this answer



























                    2














                    In C++ the :: is called the Scope Resolution Operator. It makes it clear to which namespace or class a symbol belongs.






                    share|improve this answer

























                      2












                      2








                      2







                      In C++ the :: is called the Scope Resolution Operator. It makes it clear to which namespace or class a symbol belongs.






                      share|improve this answer













                      In C++ the :: is called the Scope Resolution Operator. It makes it clear to which namespace or class a symbol belongs.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Mar 17 '11 at 21:36









                      maericsmaerics

                      106k29203251




                      106k29203251





















                          1














                          It declares a namespace. So in AirlineTicket:: you can call all public functions of the AirlineTicket class and AirlineTicket() is the function in that namespace (in this case the constructor).






                          share|improve this answer



























                            1














                            It declares a namespace. So in AirlineTicket:: you can call all public functions of the AirlineTicket class and AirlineTicket() is the function in that namespace (in this case the constructor).






                            share|improve this answer

























                              1












                              1








                              1







                              It declares a namespace. So in AirlineTicket:: you can call all public functions of the AirlineTicket class and AirlineTicket() is the function in that namespace (in this case the constructor).






                              share|improve this answer













                              It declares a namespace. So in AirlineTicket:: you can call all public functions of the AirlineTicket class and AirlineTicket() is the function in that namespace (in this case the constructor).







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Mar 17 '11 at 21:36









                              Benedikt WutziBenedikt Wutzi

                              153518




                              153518





















                                  0














                                  AirlineTicket is like a namespace for your class. You have to use it in the implementation of the constructor.






                                  share|improve this answer



























                                    0














                                    AirlineTicket is like a namespace for your class. You have to use it in the implementation of the constructor.






                                    share|improve this answer

























                                      0












                                      0








                                      0







                                      AirlineTicket is like a namespace for your class. You have to use it in the implementation of the constructor.






                                      share|improve this answer













                                      AirlineTicket is like a namespace for your class. You have to use it in the implementation of the constructor.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Mar 17 '11 at 21:35









                                      ChrisChris

                                      3542416




                                      3542416



























                                          draft saved

                                          draft discarded
















































                                          Thanks for contributing an answer to Stack Overflow!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid


                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.

                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function ()
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f5345527%2fwhat-does-the-mean-in-c%23new-answer', 'question_page');

                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                                          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                                          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived