Thread: Noob needs help.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    1

    Noob needs help.

    Hi guys, I'm currently teaching myself c via 'Sams Teach yourself C Programming in one hour a day'(Seventh Edition). I'm not sure if this is an error in the book or I'm typing something wrong but for some reason this code will not compile, and shows an error "'too few arguments to function 'fgets'"

    What would be the proper way to write this code? Thanks for the help.

    Code:
      /* ex02-05.c */
      #include <stdio.h>
      #include <string.h>
      int main(void)
      {
          char buffer[256];
    
          printf( "Enter your name and press <Enter>:\n");
          fgets( buffer );
    
          printf( "\nYour name has %d characters and spaces!",
                           strlen( buffer ));
    
         return 0;
     }
    Last edited by radzio; 10-30-2013 at 07:56 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. noob to C need a little help!!!
    By sk8harddiefast in forum C Programming
    Replies: 8
    Last Post: 02-27-2010, 02:47 PM
  2. need some noob help
    By klmdb in forum C Programming
    Replies: 3
    Last Post: 01-16-2010, 11:03 AM
  3. need some C noob help
    By klmdb in forum C Programming
    Replies: 3
    Last Post: 12-20-2009, 02:37 PM
  4. noob
    By valthyx in forum C++ Programming
    Replies: 36
    Last Post: 07-22-2008, 01:04 PM
  5. noob help
    By Xenofon in forum C Programming
    Replies: 5
    Last Post: 10-05-2006, 05:42 AM