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. Other Discussions
  3. The Weird and The Wonderful
  4. Fun with pointers in C++

Fun with pointers in C++

Scheduled Pinned Locked Moved The Weird and The Wonderful
c++question
33 Posts 16 Posters 4 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.
  • K KP Lee

    Daniel Pfeffer wrote:

    IMO, this is a quite useful C++ paradigm.

    ...and that makes me even happier to barely being able to read C++ :laugh:

    D Offline
    D Offline
    Daniel Pfeffer
    wrote on last edited by
    #24

    De gustibus non est disputandum :)

    If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

    K B 2 Replies Last reply
    0
    • D Daniel Pfeffer

      De gustibus non est disputandum :)

      If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

      K Offline
      K Offline
      KP Lee
      wrote on last edited by
      #25

      That's what I like about this forum. You go in thinking programming and you get a bit of Latin training. Hope I remember what the phrase means next time I see it.

      D 1 Reply Last reply
      0
      • K KP Lee

        That's what I like about this forum. You go in thinking programming and you get a bit of Latin training. Hope I remember what the phrase means next time I see it.

        D Offline
        D Offline
        Daniel Pfeffer
        wrote on last edited by
        #26

        Me too. There are plenty of sites around that merely answer programming questions, but only a few with the range of highly intelligent, humorous, and opinionated contributors that you find here. Amazingly, the amount of sniping and backbiting is kept to a minimum! Long may it last!

        If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

        G K 2 Replies Last reply
        0
        • D Daniel Pfeffer

          Me too. There are plenty of sites around that merely answer programming questions, but only a few with the range of highly intelligent, humorous, and opinionated contributors that you find here. Amazingly, the amount of sniping and backbiting is kept to a minimum! Long may it last!

          If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

          G Offline
          G Offline
          grralph1
          wrote on last edited by
          #27

          Beautifully expressed and I agree totally.

          "Rock journalism is people who can't write interviewing people who can't talk for people who can't read." Frank Zappa 1980

          1 Reply Last reply
          0
          • D Daniel Pfeffer

            Me too. There are plenty of sites around that merely answer programming questions, but only a few with the range of highly intelligent, humorous, and opinionated contributors that you find here. Amazingly, the amount of sniping and backbiting is kept to a minimum! Long may it last!

            If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

            K Offline
            K Offline
            KP Lee
            wrote on last edited by
            #28

            Daniel Pfeffer wrote:

            Amazingly, the amount of sniping and backbiting is kept to a minimum!

            Hear Hear (Or is that Here Here? :laugh: ) Sometimes I find myself biting my tongue, but not on this thread. (Yet, and this thread is starting to grow a beard)

            1 Reply Last reply
            0
            • M Mario Vernari

              In two hours you can have a great lunch, jogging, some fun with your partner, some nice song listening/playing and also a shower. All that cannot be done because the language is cryptic: that's why I hate C/C++! Good post, though...

              K Offline
              K Offline
              KP Lee
              wrote on last edited by
              #29

              Mario Vernari wrote:

              that's why I hate C/C++!

              Yea, I kind of agree with that sentiment, however, I have yet to run across the language that will supply me with a great lunch, but I do admit to sometimes having fun with it. (Does that mean I'm cheating on my partner?)

              1 Reply Last reply
              0
              • M Mario Vernari

                In two hours you can have a great lunch, jogging, some fun with your partner, some nice song listening/playing and also a shower. All that cannot be done because the language is cryptic: that's why I hate C/C++! Good post, though...

                K Offline
                K Offline
                KP Lee
                wrote on last edited by
                #30

                Mario Vernari wrote:

                that's why I hate C/C++!

                Yea, I kind of agree with that sentiment, however, I have yet to run across the language that will supply me with a great lunch, but I do admit to sometimes having fun with it. (Not C++ and does that mean I'm cheating on my partner?)

                1 Reply Last reply
                0
                • D Daniel Pfeffer

                  De gustibus non est disputandum :)

                  If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

                  B Offline
                  B Offline
                  Bernhard Hiller
                  wrote on last edited by
                  #31

                  Daniel Pfeffer wrote:

                  De gustibus non est disputandum :)

                  I.e. C++ is the Durian (stinkfruit) in Software Development.

                  1 Reply Last reply
                  0
                  • D Daniel Pfeffer

                    C3D1 wrote:

                    Returning references would make it much harder to read

                    We'll just have to agree to disagree on that. IMO, this is a quite useful C++ paradigm.

                    If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

                    R Offline
                    R Offline
                    Rob Grainger
                    wrote on last edited by
                    #32

                    I agree, but I definitely would not name such a function "GetA".

                    "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

                    1 Reply Last reply
                    0
                    • C C3D1

                      Sorry, that's not my code, an i cant change it. I just saw it in some code and where surprised what's that :D Returning references would make it much harder to read:

                      GetA() = GetB()

                      looks like What the hell? Assignment to a Function? :omg: :wtf:

                      L Offline
                      L Offline
                      Luiz Monad
                      wrote on last edited by
                      #33

                      You can't read C++ code without knowing the types. Who knows if equals was overridden, everything could happen. Even then you should read, GetA() return something, then operator = is called on this something.

                      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