When to use the &?

This is a discussion on When to use the &? within the C Programming forums, part of the General Programming Boards category; I have noticed from pointers to scanf() the & moves it way in and out. I have done some reading ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    65

    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
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,622
    The answer: http://c-faq.com/stdio/scanf1a.html

    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.
    http://www.daniweb.com/tutorials/tutorial45806.html


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

  3. #3
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21