Thread: how to be a good C programmer?

  1. #16
    lfs addicted
    Join Date
    Nov 2007
    Quote Originally Posted by Adak View Post
    Getting away from using parts of the language that have been found troublesome - like scanf() for user input, or gets(). Maybe not the first month out, but as soon as you understand their deficiencies, switch to the better alternatives.
    Just to know... which are the alternatives?

    Isn't it good something like:

    char s[5];

  2. #17
    Registered User
    Join Date
    Sep 2006
    Almost always no. I use scanf only for little utility / fun programs.

    You want fgets(), because it takes away the "brittleness" of scanf *and* the newline char whenever you hit the enter key with entry of some value from the user.

    Scanf() is definitely "down and dirty", and has proven to be WAY down and VERY dirty, indeed.

  3. #18
    Young C n00b
    Join Date
    Jul 2006
    Vs is good to start with

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Good C++ books for a begginer
    By Rare177 in forum C++ Programming
    Replies: 13
    Last Post: 06-22-2004, 04:30 PM
  2. Good sound storage method
    By VirtualAce in forum Game Programming
    Replies: 1
    Last Post: 10-14-2003, 05:18 AM
  3. linked list recursive function spaghetti
    By ... in forum C++ Programming
    Replies: 4
    Last Post: 09-02-2003, 02:53 PM
  4. Opinion on GOOD digicam
    By Shadow in forum A Brief History of
    Replies: 0
    Last Post: 08-22-2003, 05:37 PM
  5. Question about atheists
    By gcn_zelda in forum A Brief History of
    Replies: 160
    Last Post: 08-11-2003, 11:50 AM