Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. colon operation

colon operation

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionlearning
13 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FlyingDancer
    wrote on last edited by
    #1

    ilist_item *next = _current << _current = _current->next() : _current; I don't know the meaning of the above sentence extracted from book "C++ primer 3rd" Could somebody tell me its meaning? Thanks in advance!

    T P J 3 Replies Last reply
    0
    • F FlyingDancer

      ilist_item *next = _current << _current = _current->next() : _current; I don't know the meaning of the above sentence extracted from book "C++ primer 3rd" Could somebody tell me its meaning? Thanks in advance!

      T Offline
      T Offline
      Ted Ferenc
      wrote on last edited by
      #2

      Are you sure this is not a typo and it should be the conditional operator? ilist_item *next = _current << _current **?** _current->next() : _current; That does not look correct either, but it depends on the code, i.e. if _current != NULL go to the next node, otherwise return NULL Of course I could be wrong:-O


      "The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard

      F 1 Reply Last reply
      0
      • F FlyingDancer

        ilist_item *next = _current << _current = _current->next() : _current; I don't know the meaning of the above sentence extracted from book "C++ primer 3rd" Could somebody tell me its meaning? Thanks in advance!

        P Offline
        P Offline
        Prakash Nadar
        wrote on last edited by
        #3

        it is accessing the constructor (maybe) of that object. My God is more powerfull Than Your God. (the line that divides the world)

        F 1 Reply Last reply
        0
        • T Ted Ferenc

          Are you sure this is not a typo and it should be the conditional operator? ilist_item *next = _current << _current **?** _current->next() : _current; That does not look correct either, but it depends on the code, i.e. if _current != NULL go to the next node, otherwise return NULL Of course I could be wrong:-O


          "The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard

          F Offline
          F Offline
          FlyingDancer
          wrote on last edited by
          #4

          I don't know if it is right I only got it from a book "C++ Primer 3rd" It is in sector 5.11.1 :(

          T 1 Reply Last reply
          0
          • F FlyingDancer

            I don't know if it is right I only got it from a book "C++ Primer 3rd" It is in sector 5.11.1 :(

            T Offline
            T Offline
            Ted Ferenc
            wrote on last edited by
            #5

            I assume the book is:- http://www.awprofessional.com/catalog/product.asp?product_id={B668B50F-696A-4219-8ABD-BEDA96CBC10A}&session_id={50C3D76B-22C3-4D54-83E3-7117D77DADEE}[^] try the errata section, but waut a while someone clever than me may have the definitive answer!


            "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

            F 2 Replies Last reply
            0
            • T Ted Ferenc

              I assume the book is:- http://www.awprofessional.com/catalog/product.asp?product_id={B668B50F-696A-4219-8ABD-BEDA96CBC10A}&session_id={50C3D76B-22C3-4D54-83E3-7117D77DADEE}[^] try the errata section, but waut a while someone clever than me may have the definitive answer!


              "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

              F Offline
              F Offline
              FlyingDancer
              wrote on last edited by
              #6

              Yes It is Only my book is translated into chinese. Those code may be found in A Linked List Example of chapter 5 Statements Great! Thanks!!!

              1 Reply Last reply
              0
              • P Prakash Nadar

                it is accessing the constructor (maybe) of that object. My God is more powerfull Than Your God. (the line that divides the world)

                F Offline
                F Offline
                FlyingDancer
                wrote on last edited by
                #7

                The code is extracted from the function below: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current <<_current = _current->next() :_current; } Mavbe the right is as Mr. Ted Ferenc said: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current ? _current = _current->next() : _current; } Do you think so? Thanks for your answer!!! Happy 2004!!!

                1 Reply Last reply
                0
                • T Ted Ferenc

                  I assume the book is:- http://www.awprofessional.com/catalog/product.asp?product_id={B668B50F-696A-4219-8ABD-BEDA96CBC10A}&session_id={50C3D76B-22C3-4D54-83E3-7117D77DADEE}[^] try the errata section, but waut a while someone clever than me may have the definitive answer!


                  "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

                  F Offline
                  F Offline
                  FlyingDancer
                  wrote on last edited by
                  #8

                  The code is extracted from the function below: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current <<_current = _current->next() :_current; } Mavbe the right is as you said, that is a conditional operator: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current ? _current = _current->next() : _current; } Do you think so? Thanks for your answer!!! Happy 2004!!! :)

                  T 1 Reply Last reply
                  0
                  • F FlyingDancer

                    The code is extracted from the function below: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current <<_current = _current->next() :_current; } Mavbe the right is as you said, that is a conditional operator: inline ilist_item* ilist:: next_iter() { ilist_item *next =_current ? _current = _current->next() : _current; } Do you think so? Thanks for your answer!!! Happy 2004!!! :)

                    T Offline
                    T Offline
                    Ted Ferenc
                    wrote on last edited by
                    #9

                    I can't say 100%, the simple test is to try and compile the code and step through using the debugger. What I think it is, is a class to iterate through a linked list, where _current is the current node, next_item() checks if _current has been defined is so get the next node, otherwise return _current, which I asuume is NULL Isn't C++ fun!


                    "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

                    F 1 Reply Last reply
                    0
                    • F FlyingDancer

                      ilist_item *next = _current << _current = _current->next() : _current; I don't know the meaning of the above sentence extracted from book "C++ primer 3rd" Could somebody tell me its meaning? Thanks in advance!

                      J Offline
                      J Offline
                      Jorgen Sigvardsson
                      wrote on last edited by
                      #10

                      You know.. that subject line sure looked suspicious for a forum like this. :rolleyes: -- They say the most horrible things, but I hear violins. When I close my eyes, I'm at the center of the sun.

                      R 1 Reply Last reply
                      0
                      • J Jorgen Sigvardsson

                        You know.. that subject line sure looked suspicious for a forum like this. :rolleyes: -- They say the most horrible things, but I hear violins. When I close my eyes, I'm at the center of the sun.

                        R Offline
                        R Offline
                        Roger Wright
                        wrote on last edited by
                        #11

                        We don't have a medical forum yet, Jörgen.;P "Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.

                        J 1 Reply Last reply
                        0
                        • R Roger Wright

                          We don't have a medical forum yet, Jörgen.;P "Another day done - All targets met; all systems fully operational; all customers satisfied; all staff keen and well motivated; all pigs fed and ready to fly" - Jennie A.

                          J Offline
                          J Offline
                          Jorgen Sigvardsson
                          wrote on last edited by
                          #12

                          True. I figure this forum can only treat missing semicolons and related issues. ;) -- They say the most horrible things, but I hear violins. When I close my eyes, I'm at the center of the sun.

                          1 Reply Last reply
                          0
                          • T Ted Ferenc

                            I can't say 100%, the simple test is to try and compile the code and step through using the debugger. What I think it is, is a class to iterate through a linked list, where _current is the current node, next_item() checks if _current has been defined is so get the next node, otherwise return _current, which I asuume is NULL Isn't C++ fun!


                            "There is no monument dedicated to the memory of a committee." - Lester J. Pourciau

                            F Offline
                            F Offline
                            FlyingDancer
                            wrote on last edited by
                            #13

                            Yeah! C++ is very fun and it is abundant in perfect thinking!

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups