What does this code mean?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sier

    What does this code mean?

    CL_ConsoleWindo w console("Consol e");

    Is this some c++ idiom or a macro? I know you can't tell without the
    headers, but I want a quick explanation.
  • Jacques Labuschagne

    #2
    Re: What does this code mean?

    Sier wrote:
    [color=blue]
    > CL_ConsoleWindo w console("Consol e");
    >
    > Is this some c++ idiom or a macro? I know you can't tell without the
    > headers, but I want a quick explanation.[/color]

    Looks like it's declaring an object called 'console' with type
    'CL_ConsoleWind ow'. The constructor of that object is being
    passed the const char* "Console".

    Nothing odd there... Like you say, we could tell you more with headers.

    Jacques.

    Comment

    • Sier

      #3
      Re: What does this code mean?

      Jacques Labuschagne <jacques@clawsh rimp.com> wrote on Wed, 07 Jan 2004
      12:03:25 GMT in comp.lang.c++:
      [color=blue]
      > Looks like it's declaring an object called 'console' with type
      > 'CL_ConsoleWind ow'. The constructor of that object is being
      > passed the const char* "Console".
      >[/color]

      Yes, but doesn't it have a name? Sorry but I'm inexperienced with C++.

      Comment

      • tom_usenet

        #4
        Re: What does this code mean?

        On 7 Jan 2004 12:37:51 GMT, Sier <nosmapplease@s omewhere.com> wrote:
        [color=blue]
        >Jacques Labuschagne <jacques@clawsh rimp.com> wrote on Wed, 07 Jan 2004
        >12:03:25 GMT in comp.lang.c++:
        >[color=green]
        >> Looks like it's declaring an object called 'console' with type
        >> 'CL_ConsoleWind ow'. The constructor of that object is being
        >> passed the const char* "Console".
        >>[/color]
        >
        >Yes, but doesn't it have a name? Sorry but I'm inexperienced with C++.[/color]

        What doesn't have a name? The declared object (assuming the code is as
        Jacques says) has the name console.

        Tom

        C++ FAQ: http://www.parashift.com/c++-faq-lite/
        C FAQ: http://www.eskimo.com/~scs/C-faq/top.html

        Comment

        • Seth Morecraft

          #5
          Re: What does this code mean?

          Sier wrote:[color=blue]
          > CL_ConsoleWindo w console("Consol e");
          >
          > Is this some c++ idiom or a macro? I know you can't tell without the
          > headers, but I want a quick explanation.[/color]


          This is straight from the Clanlid Game SDK (http://www.clanlib.org)
          - From the Examples:
          // Create a console window for text-output if not available
          CL_ConsoleWindo w console("Debug Console");
          Check out the documentation of the Clanlib package for more information
          on what it does- but the comment really says it all. Hope this helps!

          Seth

          ~ Let us linux ~


          -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
          http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
          -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

          Comment

          • Rolf Magnus

            #6
            Re: What does this code mean?

            Sier wrote:
            [color=blue]
            > Jacques Labuschagne <jacques@clawsh rimp.com> wrote on Wed, 07 Jan 2004
            > 12:03:25 GMT in comp.lang.c++:
            >[color=green]
            >> Looks like it's declaring an object called 'console' with type
            >> 'CL_ConsoleWind ow'. The constructor of that object is being
            >> passed the const char* "Console".
            >>[/color]
            >
            > Yes, but doesn't it have a name?[/color]

            Read again:
            [color=blue][color=green]
            >> Looks like it's declaring an object called 'console'...[/color][/color]

            Comment

            • Catalin Pitis

              #7
              Re: What does this code mean?


              "Sier" <nosmapplease@s omewhere.com> wrote in message
              news:Xns946994D BAF6E7t45fs6vve @130.133.1.4...[color=blue]
              > Jacques Labuschagne <jacques@clawsh rimp.com> wrote on Wed, 07 Jan 2004
              > 12:03:25 GMT in comp.lang.c++:
              >[color=green]
              > > Looks like it's declaring an object called 'console' with type
              > > 'CL_ConsoleWind ow'. The constructor of that object is being
              > > passed the const char* "Console".
              > >[/color]
              >
              > Yes, but doesn't it have a name? Sorry but I'm inexperienced with C++.[/color]

              If you are refering to the constructor name, it is the same as the class
              name. This is the way an object is built at declaration time (the
              constructor doesn't appear explicitly in the declaration).

              Catalin


              Comment

              • Dan Cernat

                #8
                Re: What does this code mean?

                Sier <nosmapplease@s omewhere.com> wrote in message news:<Xns94698E 880B1C9t45fs6vv e@130.133.1.4>. ..[color=blue]
                > CL_ConsoleWindo w console("Consol e");
                >
                > Is this some c++ idiom or a macro? I know you can't tell without the
                > headers, but I want a quick explanation.[/color]

                apparently this is a variable declaration:

                it declares a variable named 'console' of type 'CL_ConsoleWind ow' and
                initializes it with the string "Console"

                Dan

                Comment

                • Psymaster

                  #9
                  Re: What does this code mean?

                  tom_usenet <tom_usenet@hot mail.com> wrote on Wed, 07 Jan 2004
                  13:04:05 GMT in comp.lang.c++:
                  [color=blue][color=green]
                  >>Yes, but doesn't it have a name? Sorry but I'm inexperienced with
                  >>C++.[/color]
                  >
                  > What doesn't have a name? The declared object (assuming the code
                  > is as Jacques says) has the name console.
                  >[/color]

                  Duh. Sorry for the silly questions.

                  Comment

                  • Sier

                    #10
                    Re: What does this code mean?

                    "Catalin Pitis" <catalin.pitis. removeme@iquest int.com> wrote on Wed, 07
                    Jan 2004 13:21:08 GMT in comp.lang.c++:
                    [color=blue]
                    > This is the way an object is built at declaration time (the
                    > constructor doesn't appear explicitly in the declaration).
                    >
                    >[/color]

                    That's what I had forgot from my little experience with c++. I plan to
                    work with this library and I wanted to be comfortable with the c++
                    syntax before I start working on a project.

                    Comment

                    • jeffc

                      #11
                      Re: What does this code mean?


                      "Sier" <nosmapplease@s omewhere.com> wrote in message
                      news:Xns94698E8 80B1C9t45fs6vve @130.133.1.4...[color=blue]
                      > CL_ConsoleWindo w console("Consol e");
                      >
                      > Is this some c++ idiom or a macro? I know you can't tell without the
                      > headers, but I want a quick explanation.[/color]

                      It's not a known C++ idiom or macro. It looks like Windows stuff to me.


                      Comment

                      • Mike Wahler

                        #12
                        Re: What does this code mean?


                        "Catalin Pitis" <catalin.pitis. removeme@iquest int.com> wrote in message
                        news:bth16s$764 ei$1@ID-153006.news.uni-berlin.de...[color=blue]
                        >
                        > "Sier" <nosmapplease@s omewhere.com> wrote in message
                        > news:Xns946994D BAF6E7t45fs6vve @130.133.1.4...[color=green]
                        > > Jacques Labuschagne <jacques@clawsh rimp.com> wrote on Wed, 07 Jan 2004
                        > > 12:03:25 GMT in comp.lang.c++:
                        > >[color=darkred]
                        > > > Looks like it's declaring an object called 'console' with type
                        > > > 'CL_ConsoleWind ow'. The constructor of that object is being
                        > > > passed the const char* "Console".
                        > > >[/color]
                        > >
                        > > Yes, but doesn't it have a name? Sorry but I'm inexperienced with C++.[/color]
                        >
                        > If you are refering to the constructor name, it is the same as the class
                        > name.[/color]

                        No. Constructors do not have names. (12.1/1)

                        -Mike


                        Comment

                        Working...