Files
2025-10-25 03:02:53 +03:00

9.1 KiB

[c.files]

31 Input/output library [input.output]

31.13 C library files [c.files]

31.13.1 Header synopsis [cstdio.syn]

🔗

#define STDC_VERSION_STDIO_H 202311Lnamespace std {using size_t = see [support.types.layout]; using FILE = see below; using fpos_t = see below;}#define NULL see [support.types.nullptr]#define _IOFBF see below#define _IOLBF see below#define _IONBF see below#define BUFSIZ see below#define EOF see below#define FOPEN_MAX see below#define FILENAME_MAX see below#define _PRINTF_NAN_LEN_MAX see below#define L_tmpnam see below#define SEEK_CUR see below#define SEEK_END see below#define SEEK_SET see below#define TMP_MAX see below#define stderr see below#define stdin see below#define stdout see belownamespace std {int remove(const char* filename); int rename(const char* old_p, const char* new_p); FILE* tmpfile(); char* tmpnam(char* s); int fclose(FILE* stream); int fflush(FILE* stream); FILE* fopen(const char* filename, const char* mode); FILE* freopen(const char* filename, const char* mode, FILE* stream); void setbuf(FILE* stream, char* buf); int setvbuf(FILE* stream, char* buf, int mode, size_t size); int fprintf(FILE* stream, const char* format, ...); int fscanf(FILE* stream, const char* format, ...); int printf(const char* format, ...); int scanf(const char* format, ...); int snprintf(char* s, size_t n, const char* format, ...); int sprintf(char* s, const char* format, ...); int sscanf(const char* s, const char* format, ...); int vfprintf(FILE* stream, const char* format, va_list arg); int vfscanf(FILE* stream, const char* format, va_list arg); int vprintf(const char* format, va_list arg); int vscanf(const char* format, va_list arg); int vsnprintf(char* s, size_t n, const char* format, va_list arg); int vsprintf(char* s, const char* format, va_list arg); int vsscanf(const char* s, const char* format, va_list arg); int fgetc(FILE* stream); char* fgets(char* s, int n, FILE* stream); int fputc(int c, FILE* stream); int fputs(const char* s, FILE* stream); int getc(FILE* stream); int getchar(); int putc(int c, FILE* stream); int putchar(int c); int puts(const char* s); int ungetc(int c, FILE* stream); size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream); size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE* stream); int fgetpos(FILE* stream, fpos_t* pos); int fseek(FILE* stream, long int offset, int whence); int fsetpos(FILE* stream, const fpos_t* pos); long int ftell(FILE* stream); void rewind(FILE* stream); void clearerr(FILE* stream); int feof(FILE* stream); int ferror(FILE* stream); void perror(const char* s);}

1

#

The contents and meaning of the header are the same as the C standard library header <stdio.h>.

2

#

The return from each function call that delivers data to the host environment to be written to a file (See also: ISO/IEC 9899:2024, 7.21.3) is an observable checkpoint ([intro.abstract]).

3

#

Calls to the function tmpnam with an argument that is a null pointer value may introduce a data race ([res.on.data.races]) with other calls to tmpnam with an argument that is a null pointer value.

See also: ISO/IEC 9899:2024, 7.23

31.13.2 Header synopsis [cinttypes.syn]

🔗

#include // see [cstdint.syn]namespace std {using imaxdiv_t = see below; constexpr intmax_t imaxabs(intmax_t j); constexpr imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); intmax_t strtoimax(const char* nptr, char** endptr, int base); uintmax_t strtoumax(const char* nptr, char** endptr, int base); intmax_t wcstoimax(const wchar_t* nptr, wchar_t** endptr, int base); uintmax_t wcstoumax(const wchar_t* nptr, wchar_t** endptr, int base); constexpr intmax_t abs(intmax_t); // optional, see belowconstexpr imaxdiv_t div(intmax_t, intmax_t); // optional, see below}#define STDC_VERSION_INTTYPES_H 202311L#define PRIdN see below#define PRIiN see below#define PRIoN see below#define PRIuN see below#define PRIxN see below#define PRIXN see below#define PRIbN see below#define PRIBN see below#define SCNdN see below#define SCNiN see below#define SCNoN see below#define SCNuN see below#define SCNxN see below#define SCNbN see below#define PRIdLEASTN see below#define PRIiLEASTN see below#define PRIoLEASTN see below#define PRIuLEASTN see below#define PRIxLEASTN see below#define PRIXLEASTN see below#define PRIbLEASTN see below#define PRIBLEASTN see below#define SCNdLEASTN see below#define SCNiLEASTN see below#define SCNoLEASTN see below#define SCNuLEASTN see below#define SCNxLEASTN see below#define SCNbLEASTN see below#define PRIdFASTN see below#define PRIiFASTN see below#define PRIoFASTN see below#define PRIuFASTN see below#define PRIxFASTN see below#define PRIXFASTN see below#define PRIbFASTN see below#define PRIBFASTN see below#define SCNdFASTN see below#define SCNiFASTN see below#define SCNoFASTN see below#define SCNuFASTN see below#define SCNxFASTN see below#define SCNbFASTN see below#define PRIdMAX see below#define PRIiMAX see below#define PRIoMAX see below#define PRIuMAX see below#define PRIxMAX see below#define PRIXMAX see below#define PRIbMAX see below#define PRIBMAX see below#define SCNdMAX see below#define SCNiMAX see below#define SCNoMAX see below#define SCNuMAX see below#define SCNxMAX see below#define SCNbMAX see below#define PRIdPTR see below#define PRIiPTR see below#define PRIoPTR see below#define PRIuPTR see below#define PRIxPTR see below#define PRIXPTR see below#define PRIbPTR see below#define PRIBPTR see below#define SCNdPTR see below#define SCNiPTR see below#define SCNoPTR see below#define SCNuPTR see below#define SCNxPTR see below#define SCNbPTR see below

1

#

The contents and meaning of the header are the same as the C standard library header <inttypes.h>, with the following changes:

The header includes the header instead of <stdint.h>, and

if and only if the type intmax_t designates an extended integer type ([basic.fundamental]), the following function signatures are added:constexpr intmax_t abs(intmax_t);constexpr imaxdiv_t div(intmax_t, intmax_t); which shall have the same semantics as the function signaturesconstexpr intmax_t imaxabs(intmax_t) andconstexpr imaxdiv_t imaxdiv(intmax_t, intmax_t), respectively.

See also: ISO/IEC 9899:2024, 7.8

2

#

Each of the PRI macros listed in this subclause is defined if and only if the implementation defines the corresponding typedef-name in [cstdint.syn].

Each of the SCN macros listed in this subclause is defined if and only if the implementation defines the corresponding typedef-name in [cstdint.syn] and has a suitable fscanf length modifier for the type.

Each of the PRIB macros listed in this subclause is defined if and only if fprintf supports the B conversion specifier.