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++ 3.0r4 - <b>scanf</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
scanf

Usage

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

   ANSI

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>
   #include <stdlib.h>

   int main()

   {
       unsigned int result, val;
       printf("Enter a decimal integer: ");
       result = scanf("%i",&val);
       printf("The decimal number [%d]",val);
       printf(" is [%4x] hexadecimal\n",val);
       return EXIT_SUCCESS;
   }

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




See Also: printf fscanf sscanf

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