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 20:53
Read: times


 
#140356 - Be careful
Responding to: ???'s previous message
Raghu said:
I really felt happy after seeing your one line solution. I always had been an assembly language guy and migrated to C recently - and any amount of reading and trying cannot match a single 'smart' example. Thanks.

You're welcome.

There could be arguments if its simpler on the code or on the MCU but in my position I am happy if its simpler to code!

That's fine if the scanf() solution really meets your needs. But please don't ignore the comments of some of the other posters. Neil in particular made some very good points ... scanf() can fail miserably if the input isn't exactly what you're expecting.

-- Russ



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