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

                                          Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

                                          Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

                                          How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page