Thread: When to use the &?

  1. #1
    Registered User
    Join Date
    Nov 2006

    When to use the &?

    I have noticed from pointers to scanf() the & moves it way in and out. I have done some reading on it and I still think I abuse ether the true purpose of it or simply dont use it when I should. I have been wondering if anyone has a great link (one that is not to the lession plans on the website, I have read through them all more then a few times) or can explain it to me. Thanks for your time.

  2. #2
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    United States
    The answer:

    Three out of four experts agree* that learning to use scanf correctly can take as long as learning the language itself. Therefore it is wise to avoid calling it if you can.

    *72% of the statistics in this post are pulled out of the blue.

  3. #3
    Fear the Reaper...
    Join Date
    Aug 2005
    Toronto, Ontario, Canada
    Agreed. fgets + sscanf for the win...
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

Popular pages Recent additions subscribe to a feed