Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - scanf http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   scanf

   Usage
   #include <stdio.h>
   int scanf(char *format,...);

   Description
   scanf is a formatted input routine which obtains its input from stdin.
   Apart from the format string, the arguments must be pointers to  where
   values are stored.

   For  details  of the format and usage of this function  refer  to  the
   entry for fscanf.

   Example
   #include <stdio.h>
   main()
   {
   unsigned int result, val;
        printf("Enter a decimal integer: ");
        result = scanf("%i",&val);
        printf("The decimal number [%d] is [%4x] hexadecimal",val,val);
   }

   Return Value
   The number of assigned input items excluding any assignment suppressed
   conversions is returned. If the end of file is encountered before  any
   assignments  are  done  or  before any  conflicts  occur,  an  EOF  is
   returned.  scanf()  normally returns when it reaches the  end  of  the
   format string.


See Also: printf fscanf sscanf

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson