Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/06/07 19:22
Read: times


 
#140343 - scanf()
Responding to: ???'s previous message
scanf() is a very bad choice.
And being big is not the only issue.
It is blocking. If you do not get all of the chars, you are hung.
One to many, stuck again. (like when plugging in or out the cable or turning on the PC). Wrong type of Data. It will wait for more.
gets() or getc() are better choices.

In my opinon scanf() is for beginner school projects. It was not even that useful for desktop use back in the DOS days.


List of 39 messages in thread
TopicAuthorDate
String to decimal numbers            01/01/70 00:00      
   Piece of cake            01/01/70 00:00      
      Answer is correct - just do it 4 times!            01/01/70 00:00      
      No, Andy -- Joe\\\'s answer is not correct            01/01/70 00:00      
         simpler????            01/01/70 00:00      
            Simpler            01/01/70 00:00      
               scanf, printf....            01/01/70 00:00      
               scanf()            01/01/70 00:00      
                  Warnings well taken.            01/01/70 00:00      
         My response shows how to do it            01/01/70 00:00      
            the 1-line solution            01/01/70 00:00      
               Now that we\'re being silly ...            01/01/70 00:00      
                  I'm tempted to give it a "+1 Good answer" :-)            01/01/70 00:00      
                  As Cryptic as it can get.. (for me)            01/01/70 00:00      
                     Don't try this at home!!!            01/01/70 00:00      
                        Maybe try at home but NOT with the client !            01/01/70 00:00      
                  all 4 numbers, printf-ed, all in one for            01/01/70 00:00      
                     One small correction            01/01/70 00:00      
                        The world would come to a voilent end.            01/01/70 00:00      
                           this was nothing...            01/01/70 00:00      
                              Jan loves C ??? World go KAABOOM!!            01/01/70 00:00      
                     Jan, you are a wild man!!!            01/01/70 00:00      
                        I am cool serious.            01/01/70 00:00      
                           I've been learning C too!            01/01/70 00:00      
                              K&R            01/01/70 00:00      
                                 K&R * 3            01/01/70 00:00      
                                    The separation of AWK and Perl duly noted            01/01/70 00:00      
                                    I only have the one...            01/01/70 00:00      
   How about...            01/01/70 00:00      
      weekend quiz?            01/01/70 00:00      
         Ok, so it might have been a bit cryptic            01/01/70 00:00      
   Uncanny Adverts            01/01/70 00:00      
      OT - Google magic            01/01/70 00:00      
         Missed concepts..            01/01/70 00:00      
            Be careful            01/01/70 00:00      
               gets() is differently bad            01/01/70 00:00      
                  still better than scanf()            01/01/70 00:00      
                     or, don't bother with the stdlib etc. at all            01/01/70 00:00      
                        for me, replace 'rarely' with 'never'            01/01/70 00:00      

Back to Subject List