scanf - Online Linux Manual PageSection : 3
Updated : 2022-12-29
Source : Linux man-pages 6.03
NAMEscanf, fscanf, vscanf, vfscanf − input FILE format conversion
LIBRARYStandard C library (libc, −lc)
SYNOPSIS#include <stdio.h>int scanf(const char *restrict format, ...);
int fscanf(FILE *restrict stream,
const char *restrict format, ...);#include <stdarg.h>int vscanf(const char *restrict format, va_list ap);
int vfscanf(FILE *restrict stream,
const char *restrict format, va_list ap);Feature Test Macro Requirements for glibc (see feature_test_macros(7)): vscanf(), vfscanf(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
DESCRIPTIONThe scanf() family of functions scans input like sscanf(3), but read from a FILE. It is very difficult to use these functions correctly, and it is preferable to read entire lines with fgets(3) or getline(3) and parse them later with sscanf(3) or more specialized functions such as strtol(3). The scanf() function reads input from the standard input stream stdin and fscanf() reads input from the stream pointer stream. The vfscanf() function is analogous to vfprintf(3) and reads input from the stream pointer stream using a variable argument list of pointers (see stdarg(3). The vscanf() function is analogous to vprintf(3) and reads from the standard input.
RETURN VALUEOn success, these functions return the number of input items successfully matched and assigned; this can be fewer than provided for, or even zero, in the event of an early matching failure. The value EOF is returned if the end of input is reached before either the first successful conversion or a matching failure occurs. EOF is also returned if a read error occurs, in which case the error indicator for the stream (see ferror(3)) is set, and errno is set to indicate the error.
ERRORSEAGAIN The file descriptor underlying stream is marked nonblocking, and the read operation would block. EBADF The file descriptor underlying stream is invalid, or not open for reading. EILSEQ Input byte sequence does not form a valid character. EINTR The read operation was interrupted by a signal; see signal(7). EINVAL Not enough arguments; or format is NULL. ENOMEM Out of memory.
ATTRIBUTESFor an explanation of the terms used in this section, see attributes(7). InterfaceAttributeValue scanf(), fscanf(), vscanf(), vfscanf() Thread safetyMT-Safe locale
STANDARDSThese functions conform to C99 and POSIX.1-2001.
SEE ALSOfgets(3), getline(3), sscanf(3) 0
Johanes Gumabo
Data Size : 12,583 byte
man-scanf.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 4 / 237,464
Visitor ID : :
Visitor IP : 3.15.34.105 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.