need help

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

    need help

    i have this class:

    class Process : public Gob
    {
    private:
    TotalAmount *Process::getTo talAmount( DetailList & dl );

    public:
    virtual void operator()(Invo ice&);
    };

    what does the :: sign mean here ?

    thanks !


  • Rolf Magnus

    #2
    Re: need help

    toto wrote:
    [color=blue]
    > i have this class:
    >
    > class Process : public Gob
    > {
    > private:
    > TotalAmount *Process::getTo talAmount( DetailList & dl );
    >
    > public:
    > virtual void operator()(Invo ice&);
    > };
    >
    > what does the :: sign mean here ?[/color]

    It means a syntax error.

    Comment

    • Sharad Kala

      #3
      Re: need help


      "toto" <nospam_noshit@ toto.com> wrote in message
      news:c24abs$hn3 $1@s1.read.news .oleane.net...[color=blue]
      > i have this class:
      >
      > class Process : public Gob
      > {
      > private:
      > TotalAmount *Process::getTo talAmount( DetailList & dl );[/color]

      Don't you get a compilation error here that qualified name is not allowed in a
      member declaration?
      [color=blue]
      > public:
      > virtual void operator()(Invo ice&);
      > };
      >
      > what does the :: sign mean here ?[/color]

      It is the scope resolution operator.
      TotalAmount *Process::getTo talAmount( DetailList & dl )
      {
      ....
      }
      This would mean that Process class has a member function called getTotalAmount.
      This is the definition of the member function.

      -Sharad



      Comment

      • Jonathan Turkanis

        #4
        Re: need help


        "toto" <nospam_noshit@ toto.com> wrote in message
        news:c24abs$hn3 $1@s1.read.news .oleane.net...[color=blue]
        > i have this class:
        >
        > class Process : public Gob
        > {
        > private:
        > TotalAmount *Process::getTo talAmount( DetailList & dl );
        >
        > public:
        > virtual void operator()(Invo ice&);
        > };[/color]

        Maybe you mean

        private:
        TotalAmount * getTotalAmount( DetailList & dl );

        (a member function declaration) or

        private:
        TotalAmount (Process::*getT otalAmount)( DetailList & dl );

        ( pointer to member decalration).

        Your syntax is half-way between the two. It is an error.

        Jonathan



        Comment

        • toto

          #5
          Re: need help

          so this would be equivalent to :

          class Process : public Gob
          {
          private:
          TotalAmount *getTotalAmount ( DetailList & dl );

          public:
          virtual void operator()(Invo ice&);
          };


          right ?

          "Sharad Kala" <no.spam_sharad k_ind@yahoo.com > a écrit dans le message de
          news: c24b9n$1pb07u$1 @ID-221354.news.uni-berlin.de...[color=blue]
          >
          > "toto" <nospam_noshit@ toto.com> wrote in message
          > news:c24abs$hn3 $1@s1.read.news .oleane.net...[color=green]
          > > i have this class:
          > >
          > > class Process : public Gob
          > > {
          > > private:
          > > TotalAmount *Process::getTo talAmount( DetailList & dl );[/color]
          >
          > Don't you get a compilation error here that qualified name is not allowed[/color]
          in a[color=blue]
          > member declaration?
          >[color=green]
          > > public:
          > > virtual void operator()(Invo ice&);
          > > };
          > >
          > > what does the :: sign mean here ?[/color]
          >
          > It is the scope resolution operator.
          > TotalAmount *Process::getTo talAmount( DetailList & dl )
          > {
          > ...
          > }
          > This would mean that Process class has a member function called[/color]
          getTotalAmount.[color=blue]
          > This is the definition of the member function.
          >
          > -Sharad
          >
          >
          >[/color]


          Comment

          • Sharad Kala

            #6
            Re: need help


            "toto" <nospam_noshit@ toto.com> wrote in message
            news:c24k26$mtg $1@s1.read.news .oleane.net...[color=blue]
            > so this would be equivalent to :
            >
            > class Process : public Gob
            > {
            > private:
            > TotalAmount *getTotalAmount ( DetailList & dl );
            >
            > public:
            > virtual void operator()(Invo ice&);
            > };
            >
            >
            > right ?[/color]

            Please don't top-post.
            Yes, this is syntactically correct.
            Note that you have just declared and not defined the member functions yet.
            You could define them within the class body (inline)-
            TotalAmount *getTotalAmount ( DetailList & dl )
            {
            ....
            }
            or
            Outside the class body
            TotalAmount *Process::getTo talAmount( DetailList & dl )
            {
            ....
            }

            -Sharad



            Comment

            • toto

              #7
              Re: need help

              ok, thanks.
              what is TOP-POST ?
              "Sharad Kala" <no.spam_sharad k_ind@yahoo.com > a écrit dans le message de
              news: c24kou$1nukv7$1 @ID-221354.news.uni-berlin.de...[color=blue]
              >
              > "toto" <nospam_noshit@ toto.com> wrote in message
              > news:c24k26$mtg $1@s1.read.news .oleane.net...[color=green]
              > > so this would be equivalent to :
              > >
              > > class Process : public Gob
              > > {
              > > private:
              > > TotalAmount *getTotalAmount ( DetailList & dl );
              > >
              > > public:
              > > virtual void operator()(Invo ice&);
              > > };
              > >
              > >
              > > right ?[/color]
              >
              > Please don't top-post.
              > Yes, this is syntactically correct.
              > Note that you have just declared and not defined the member functions yet.
              > You could define them within the class body (inline)-
              > TotalAmount *getTotalAmount ( DetailList & dl )
              > {
              > ...
              > }
              > or
              > Outside the class body
              > TotalAmount *Process::getTo talAmount( DetailList & dl )
              > {
              > ...
              > }
              >
              > -Sharad
              >
              >
              >[/color]


              Comment

              • Sharad Kala

                #8
                Re: need help


                "toto" <nospam_noshit@ toto.com> wrote in message
                news:c24ohg$p85 $1@s1.read.news .oleane.net...[color=blue]
                > ok, thanks.
                > what is TOP-POST ?[/color]

                Precisely what you have done again :-)
                That means, don't type your reply above the previous author's text.


                Best wishes,
                Sharad


                Comment

                • toto

                  #9
                  Re: need help

                  thanks !
                  hope i did it well this time ;-)
                  [color=blue]
                  > Precisely what you have done again :-)
                  > That means, don't type your reply above the previous author's text.
                  > http://www.parashift.com/c++-faq-lit...t.html#faq-5.4
                  >
                  > Best wishes,
                  > Sharad
                  >
                  >[/color]


                  Comment

                  • Default User

                    #10
                    Re: need help

                    toto wrote:[color=blue]
                    >
                    > thanks !
                    > hope i did it well this time ;-)[/color]


                    No, your replies belong following the quotes. See how I've done it?



                    Brian Rodenborn

                    Comment

                    Working...