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. The Lounge
  3. "In Defense Of Printf"

"In Defense Of Printf"

Scheduled Pinned Locked Moved The Lounge
c++
18 Posts 12 Posters 1 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.
  • S Offline
    S Offline
    Simon ORiordan from UK
    wrote on last edited by
    #1

    No mate. It isn't 'old' C++ or any kind of C++. Printf is C.

    N D H G C 6 Replies Last reply
    0
    • S Simon ORiordan from UK

      No mate. It isn't 'old' C++ or any kind of C++. Printf is C.

      D Offline
      D Offline
      den2k88
      wrote on last edited by
      #2

      Personally I prefer its use to the C++ streams, I find it much easier than all the "<<" crap. This and the fact that I rarely appreciate operator overloading (unless where it makes sense and often it is slightly limited) make me prefer plain old stable known and reliable printf's.

      Geek code v 3.12 GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++* Weapons extension: ma- k++ F+2 X

      1 Reply Last reply
      0
      • S Simon ORiordan from UK

        No mate. It isn't 'old' C++ or any kind of C++. Printf is C.

        N Offline
        N Offline
        Nagy Vilmos
        wrote on last edited by
        #3

        Printf? Never heard of it, printf however...

        1 Reply Last reply
        0
        • S Simon ORiordan from UK

          No mate. It isn't 'old' C++ or any kind of C++. Printf is C.

          H Offline
          H Offline
          HobbyProggy
          wrote on last edited by
          #4

          it doesn't matter if it's c or c++, it's not safe :/ that's what matters.

          if(this.signature != "") { MessageBox.Show("This is my signature: " + Environment.NewLine + signature); } else { MessageBox.Show("404-Signature not found"); }

          OriginalGriffO 1 Reply Last reply
          0
          • H HobbyProggy

            it doesn't matter if it's c or c++, it's not safe :/ that's what matters.

            if(this.signature != "") { MessageBox.Show("This is my signature: " + Environment.NewLine + signature); } else { MessageBox.Show("404-Signature not found"); }

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #5

            Safety is overrated: Health and Softy is getting everywhere! :laugh:

            Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            H 1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              Safety is overrated: Health and Softy is getting everywhere! :laugh:

              Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

              H Offline
              H Offline
              HobbyProggy
              wrote on last edited by
              #6

              I see why most c programs can easily be hacked :P

              if(this.signature != "") { MessageBox.Show("This is my signature: " + Environment.NewLine + signature); } else { MessageBox.Show("404-Signature not found"); }

              N 1 Reply Last reply
              0
              • S Simon ORiordan from UK

                No mate. It isn't 'old' C++ or any kind of C++. Printf is C.

                G Offline
                G Offline
                Gary Wheeler
                wrote on last edited by
                #7

                "If you can't take a little bloody nose, maybe you ought to go back home and crawl under your bed. It's not safe out here. It's wondrous, with treasures to satiate desires both subtle and gross. But it's not for the timid.[^]" Q uses printf().

                Software Zen: delete this;

                1 Reply Last reply
                0
                • H HobbyProggy

                  I see why most c programs can easily be hacked :P

                  if(this.signature != "") { MessageBox.Show("This is my signature: " + Environment.NewLine + signature); } else { MessageBox.Show("404-Signature not found"); }

                  N Offline
                  N Offline
                  Nelek
                  wrote on last edited by
                  #8

                  HobbyProggy wrote:

                  I see why most c programs can easily be hacked

                  I would say, that is not a very valid argument. Any program can be easily hacked if the programer doesn't take the needed counter messures

                  M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                  H P 2 Replies Last reply
                  0
                  • N Nelek

                    HobbyProggy wrote:

                    I see why most c programs can easily be hacked

                    I would say, that is not a very valid argument. Any program can be easily hacked if the programer doesn't take the needed counter messures

                    M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                    H Offline
                    H Offline
                    HobbyProggy
                    wrote on last edited by
                    #9

                    That is correct, but i think it's an addition to my comment not a rework :)

                    if(this.signature != "") { MessageBox.Show("This is my signature: " + Environment.NewLine + signature); } else { MessageBox.Show("404-Signature not found"); }

                    1 Reply Last reply
                    0
                    • S Simon ORiordan from UK

                      No mate. It isn't 'old' C++ or any kind of C++. Printf is C.

                      C Offline
                      C Offline
                      CafedeJamaica
                      wrote on last edited by
                      #10

                      Yo mama so fat she uses printf

                      S 1 Reply Last reply
                      0
                      • C CafedeJamaica

                        Yo mama so fat she uses printf

                        S Offline
                        S Offline
                        Slacker007
                        wrote on last edited by
                        #11

                        I don't always printf but when I do I print "f"

                        1 Reply Last reply
                        0
                        • N Nelek

                          HobbyProggy wrote:

                          I see why most c programs can easily be hacked

                          I would say, that is not a very valid argument. Any program can be easily hacked if the programer doesn't take the needed counter messures

                          M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

                          P Offline
                          P Offline
                          PhilLenoir
                          wrote on last edited by
                          #12

                          I'm not so sure - ever tried hacking Ada? You have to break Ada to make it hackable (With unchecked_conversion)!

                          Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                          S G 2 Replies Last reply
                          0
                          • P PhilLenoir

                            I'm not so sure - ever tried hacking Ada? You have to break Ada to make it hackable (With unchecked_conversion)!

                            Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                            S Offline
                            S Offline
                            Simon ORiordan from UK
                            wrote on last edited by
                            #13

                            I remember Ada. She used to make a nice cheese and tomato sandwich.

                            P 1 Reply Last reply
                            0
                            • S Simon ORiordan from UK

                              I remember Ada. She used to make a nice cheese and tomato sandwich.

                              P Offline
                              P Offline
                              PhilLenoir
                              wrote on last edited by
                              #14

                              ... and a luvverly cuppa

                              Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                              1 Reply Last reply
                              0
                              • S Simon ORiordan from UK

                                No mate. It isn't 'old' C++ or any kind of C++. Printf is C.

                                P Online
                                P Online
                                PIEBALDconsult
                                wrote on last edited by
                                #15

                                Which is a subset of C++.

                                S 1 Reply Last reply
                                0
                                • P PhilLenoir

                                  I'm not so sure - ever tried hacking Ada? You have to break Ada to make it hackable (With unchecked_conversion)!

                                  Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                                  G Offline
                                  G Offline
                                  glennPattonPub
                                  wrote on last edited by
                                  #16

                                  Ada Hacked!? I had enough trouble getting to compile :wtf:

                                  P 1 Reply Last reply
                                  0
                                  • G glennPattonPub

                                    Ada Hacked!? I had enough trouble getting to compile :wtf:

                                    P Offline
                                    P Offline
                                    PhilLenoir
                                    wrote on last edited by
                                    #17

                                    All that rigour comes at an expense! ;)

                                    Life is like a s**t sandwich; the more bread you have, the less s**t you eat.

                                    1 Reply Last reply
                                    0
                                    • P PIEBALDconsult

                                      Which is a subset of C++.

                                      S Offline
                                      S Offline
                                      Simon ORiordan from UK
                                      wrote on last edited by
                                      #18

                                      Well, sure. But if some geezer is going to go on a MS site and waffle about printf he needs to be accurate. Incidentally, gcc natively does c. Typically I've had to add g++ for c++, so they are distinct.

                                      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