Standard Library Function List
入出力
This function primarily handles files.
In C, devices other than disks can also be treated as files.
You can also treat them as designated file pointers.
These can also be modified by users through methods such as redirects.
Depending on the environment, it may be associated with another device or disabled.
In C, devices other than disks can also be treated as files.
You can also treat them as designated file pointers.
designated file pointer
stdin 標準入力(普通はキーボード)
stdout 標準出力(普通はディスプレイ)
stderr 標準Error出力(普通はディスプレイ)
stdout 標準出力(普通はディスプレイ)
stderr 標準Error出力(普通はディスプレイ)
These can also be modified by users through methods such as redirects.
Depending on the environment, it may be associated with another device or disabled.
fopen
function型 : FILE *fopen(const char *filename, const char *mode);
argument : FileName、Mode string
Return value: Opened file pointer.NULL on failure.
Function : Fileを開く。
Mode: r read, w new, a append.b-suffix for binary, + suffix for input/output.
argument : FileName、Mode string
Return value: Opened file pointer.NULL on failure.
Function : Fileを開く。
Mode: r read, w new, a append.b-suffix for binary, + suffix for input/output.
fclose
function型 : int fclose(FILE *fp);
argument : file pointer
Return value : 成功した場合は0、失敗したときはEOF
Function : Fileを閉じる。
argument : file pointer
Return value : 成功した場合は0、失敗したときはEOF
Function : Fileを閉じる。
fgetc
function型 : int fgetc(FILE *fp);
argument : file pointer
Return value: The character read.Failure or end of file (EOF).
Function : FileFrom1Character読み出す。
argument : file pointer
Return value: The character read.Failure or end of file (EOF).
Function : FileFrom1Character読み出す。
getc
Function : fgetcとまったくsame。
Caution: May contain macros, so be aware of potential side effects.
Caution: May contain macros, so be aware of potential side effects.
fgets
function型 : char *fgets(char *s, int n, FILE *fp);
argument : Stringを格納するバッファ、バッファサイズ、file pointer
Return value: The buffer specified by the argument.NULL if it failed or reached the end.
Function : FileFrom1行読み出す。The result includes a line break.
argument : Stringを格納するバッファ、バッファサイズ、file pointer
Return value: The buffer specified by the argument.NULL if it failed or reached the end.
Function : FileFrom1行読み出す。The result includes a line break.
fputc
function型 : int fputc(int c, FILE *fp);
argument : Character、file pointer
Return value: Output character.When it fails, EOF.
Function : Fileに1Character書き込む。
argument : Character、file pointer
Return value: Output character.When it fails, EOF.
Function : Fileに1Character書き込む。
putc
Function : fputcとまったくsame。
Caution: May contain macros, so be aware of potential side effects.
Caution: May contain macros, so be aware of potential side effects.
fputs
function型 : int fputs(const char *s, FILE *fp);
argument : String、file pointer
Return value: True on success, EOF on failure.
Function : FileにStringを書き込む。
argument : String、file pointer
Return value: True on success, EOF on failure.
Function : FileにStringを書き込む。
fread
function型 : size_t fread(void *ptr, size_t size, size_t nelem, FILE *fp);
argument : 読み込み結果を格納するバッファ、Size of one item、Number of items、file pointer
Return value: The number of items read.0 if it fails.
Function : FileFrom固定サイズの項目を読み込む。
argument : 読み込み結果を格納するバッファ、Size of one item、Number of items、file pointer
Return value: The number of items read.0 if it fails.
Function : FileFrom固定サイズの項目を読み込む。
fwrite
function型 : size_t fwrite(const void *ptr, size_t size, size_t nelem, FILE *fp);
argument : 書き込むバッファ、Size of one item、Number of items、file pointer
Return value: The number of items written.0 if it fails.
Function : Fileに固定サイズの項目を書き込む。
argument : 書き込むバッファ、Size of one item、Number of items、file pointer
Return value: The number of items written.0 if it fails.
Function : Fileに固定サイズの項目を書き込む。
fprintf
function型 : int fprintf(FILE *fp, const char *format, ...);
argument : file pointer、Format付きString、可変個のVariable
Return value: Number of characters output.Negative value when failed.
Function : FileにFormat付きStringを書き込む。
argument : file pointer、Format付きString、可変個のVariable
Return value: Number of characters output.Negative value when failed.
Function : FileにFormat付きStringを書き込む。
fscanf
function型 : int fscanf(FILE *fp, const char *format, ...);
argument : file pointer、変換指定String、可変個のバッファ
Return value: The number of conversions that succeeded.-1 if failed.
Function : FileFromStringを読み込み指定されたFormatに変換する。
argument : file pointer、変換指定String、可変個のバッファ
Return value: The number of conversions that succeeded.-1 if failed.
Function : FileFromStringを読み込み指定されたFormatに変換する。
ftell
function型 : long ftell(FILE *fp);
argument : file pointer
Return value: The current file position.
Function : File位置を取得する。
argument : file pointer
Return value: The current file position.
Function : File位置を取得する。
fseek
function型 : int fseek(FILE *fp, long offset, int ptrname);
argument : file pointer、File位置の移動数、File位置の基準
Return value: 0 on success, non-zero on failure.
Function : File位置を変更する。
Position : SEEK_SET beginning, SEEK_CUR current position, SEEK_END end.
argument : file pointer、File位置の移動数、File位置の基準
Return value: 0 on success, non-zero on failure.
Function : File位置を変更する。
Position : SEEK_SET beginning, SEEK_CUR current position, SEEK_END end.
fgetpos
function型 : int fgetpos(FILE *fp, fpos_t *ptr);
argument : file pointer、File位置を格納するVariableのPointer
Return value: 0 on success, non-zero on failure.Function : 現在のFile位置を格納する。
argument : file pointer、File位置を格納するVariableのPointer
Return value: 0 on success, non-zero on failure.Function : 現在のFile位置を格納する。
fsetpos
function型 : int fsetpos(FILE *fp, const fpos_t *ptr);argument : file pointer、File位置を格納するVariableのPointer
Return value: 0 on success, non-zero on failure.
Function : File位置を変更する。
Return value: 0 on success, non-zero on failure.
Function : File位置を変更する。
feof
function型 : int feof(FILE *fp);
argument : file pointer
Return value: True if the end is reached, false otherwise.
Function : Fileが終わりに到達したか調べる。
argument : file pointer
Return value: True if the end is reached, false otherwise.
Function : Fileが終わりに到達したか調べる。
ferror
function型 : int ferror(FILE *fp);
argument : file pointer
Return value: True if an error occurred, false otherwise.
Function : FileにErrorが発生したか調べる。
argument : file pointer
Return value: True if an error occurred, false otherwise.
Function : FileにErrorが発生したか調べる。
clearerr
function型 : void clearerr(FILE *fp);
argument : file pointer
Function : FileのErrorのHourに回復する。
argument : file pointer
Function : FileのErrorのHourに回復する。
fflush
function型 : int fflush(FILE *fp);
argument : file pointer
Return value: 0 on success, false on failure.
Function : 出力バッファを強制出力する。
Caution: Some compilers may clear the input buffer.However, it is heretical.
argument : file pointer
Return value: 0 on success, false on failure.
Function : 出力バッファを強制出力する。
Caution: Some compilers may clear the input buffer.However, it is heretical.
freopen
function型 : FILE *freopen(const char *filename, const char *mode, FILE *fp);
argument : FileName、Mode string、file pointer
Return value: The file pointer specified as an argument.NULL on failure.
Function : file pointerのAgain割り当て。
argument : FileName、Mode string、file pointer
Return value: The file pointer specified as an argument.NULL on failure.
Function : file pointerのAgain割り当て。
rename
function型 : int rename(const char *oldname, const char *newname);
argument : 現在のFileName、新しいFileName
Return value: 0 on success, non-zero on failure.
Function : Fileのnameを変更する。
argument : 現在のFileName、新しいFileName
Return value: 0 on success, non-zero on failure.
Function : Fileのnameを変更する。
remove
function型 : int remove(const char *filename);
argument : FileName
Return value: 0 on success, non-zero on failure.
Function : FileをDeleteする。
argument : FileName
Return value: 0 on success, non-zero on failure.
Function : FileをDeleteする。
getchar
function型 : int getchar(void);
Return value: The character read.If it fails, EOF.
Function : 標準入力(キーボード)From1Character読み込む。
Return value: The character read.If it fails, EOF.
Function : 標準入力(キーボード)From1Character読み込む。
putchar
function型 : int putchar(char c);
argument : Character
Return value: Output character.When it fails, EOF.
Function : 標準出力(ディスプレイ)に1Character書き込む。
argument : Character
Return value: Output character.When it fails, EOF.
Function : 標準出力(ディスプレイ)に1Character書き込む。
gets
function型 : char *gets(char *s);
argument : 読み込んだStringを格納するバッファ
Return value: The buffer specified by the argument.NULL if it failed or reached the end.
Function : 標準入力(キーボード)From1行読み出す。The result will not contain any line breaks.
Warning: Do not use, as it can cause a buffer overflow (potential virus intrusion).
argument : 読み込んだStringを格納するバッファ
Return value: The buffer specified by the argument.NULL if it failed or reached the end.
Function : 標準入力(キーボード)From1行読み出す。The result will not contain any line breaks.
Warning: Do not use, as it can cause a buffer overflow (potential virus intrusion).
puts
function型 : int puts(const char *s);
argument : String
Return value: 0 on success, non-zero on failure.
Function : 標準出力(ディスプレイ)に1行書き込む。It will be wrapped.
argument : String
Return value: 0 on success, non-zero on failure.
Function : 標準出力(ディスプレイ)に1行書き込む。It will be wrapped.
perror
function型 : void perror(const char *s);
argument : Table示するString
Function : 指定したStringと一緒に直前に発生したErrorをTable示する。
argument : Table示するString
Function : 指定したStringと一緒に直前に発生したErrorをTable示する。
printf
function型 : int printf(const char *format, ...);
argument : Format付きString、可変個のVariable
Return value: Number of characters output.Failure: -1.
Function : 標準出力(ディスプレイ)にFormat付きStringを書き込む。
argument : Format付きString、可変個のVariable
Return value: Number of characters output.Failure: -1.
Function : 標準出力(ディスプレイ)にFormat付きStringを書き込む。
scanf
function型 : int scanf(const char *format, ...);
argument : 変換指定String、可変個のバッファ
Return value: The number of conversions that succeeded.-1 if failed.
Function : 標準入力(キーボード)FromStringを読み込み指定されたFormatに変換する。
Caution: May exhibit unexpected behavior when used with other input functions.
argument : 変換指定String、可変個のバッファ
Return value: The number of conversions that succeeded.-1 if failed.
Function : 標準入力(キーボード)FromStringを読み込み指定されたFormatに変換する。
Caution: May exhibit unexpected behavior when used with other input functions.
汎用
A collection of generic functions that don't fit into a specific category.
Memory-related, process-related, and conversions.
Memory-related, process-related, and conversions.
malloc
function型 : void *malloc(size_t n);
argument : 確保するメモリサイズ
Return value: The address of the allocated memory.If not secured, NULL.
Function : メモリを動的に確保する。
argument : 確保するメモリサイズ
Return value: The address of the allocated memory.If not secured, NULL.
Function : メモリを動的に確保する。
calloc
function型 : void *calloc(size_t int nelem, size_t elsize);
argument : 要素数、1要素のサイズ
Return value: The address of the allocated memory.If not secured, NULL.
Function : メモリを動的に確保する。The allocated memory is zeroed.
Caution: Don't assume fewer bugs just because of zero-clear.
argument : 要素数、1要素のサイズ
Return value: The address of the allocated memory.If not secured, NULL.
Function : メモリを動的に確保する。The allocated memory is zeroed.
Caution: Don't assume fewer bugs just because of zero-clear.
realloc
function型 : void *realloc(void *ptr, size_t size);
Arguments: the address of the allocated memory, the new memory size.
Return value: The address of the allocated memory.If not secured, NULL.
Function : 確保したメモリサイズを変更する。The content will be preserved.
Please note that the memory address may change.
Arguments: the address of the allocated memory, the new memory size.
Return value: The address of the allocated memory.If not secured, NULL.
Function : 確保したメモリサイズを変更する。The content will be preserved.
Please note that the memory address may change.
free
function型 : void free(void *p);
argument : 確保したメモリのaddress
Function : 動的に確保したメモリを解放。
argument : 確保したメモリのaddress
Function : 動的に確保したメモリを解放。
abs
function型 : int abs(int n);
argument : numerics
Return value : numericsのabsolute value
Function : absolute valueを求める。
argument : numerics
Return value : numericsのabsolute value
Function : absolute valueを求める。
labs
function型 : long labs(long n);
argument : numerics
Return value : numericsのabsolute value
Function : absolute valueを求める。
argument : numerics
Return value : numericsのabsolute value
Function : absolute valueを求める。
atof
function型 : double atof(const char *s);
argument : digitをIncludeString
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを実Convert to numerical values。
argument : digitをIncludeString
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを実Convert to numerical values。
atoi
function型 : int atoi(const char *s);
argument : digitをIncludeString
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを整Convert to numerical values。
argument : digitをIncludeString
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを整Convert to numerical values。
atol
function型 : long atol(const char *s);
argument : digitをIncludeString
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを整Convert to numerical values。
argument : digitをIncludeString
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを整Convert to numerical values。
strtod
function型 : double strtod(const char *s, char **endptr);
argument : digitをIncludeString、End位置のaddress
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを実Convert to numerical values。
argument : digitをIncludeString、End位置のaddress
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを実Convert to numerical values。
strtol
function型 : long strtol(const char *s, char **endptr, int base);
argument : digitをIncludeString、End位置のaddress、numericsの基数(binary digitsやhexadecimal)
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを整Convert to numerical values。
argument : digitをIncludeString、End位置のaddress、numericsの基数(binary digitsやhexadecimal)
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを整Convert to numerical values。
strtoul
function型 : unsigned long strtoul(const char *s, char **endptr, int base);
argument : digitをIncludeString、End位置のaddress、numericsの基数(binary digitsやhexadecimal)
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを符号無し整Convert to numerical values。
argument : digitをIncludeString、End位置のaddress、numericsの基数(binary digitsやhexadecimal)
Return value: The transformed value.0 if conversion is not possible.
Function : digitをIncludeStringを符号無し整Convert to numerical values。
div
function型 : div_t div(int num, int denom);
Arguments : dividend, divisor.
Return value: The result of the division.
Function : 商と余りを同Hourに計算。
Structure: struct div_t { int quot; 商; int rem; 余り. }
Note: We recommend using the operators / and % with this function.
Arguments : dividend, divisor.
Return value: The result of the division.
Function : 商と余りを同Hourに計算。
Structure: struct div_t { int quot; 商; int rem; 余り. }
Note: We recommend using the operators / and % with this function.
ldiv
function型 : ldiv_t ldiv(long num, long denom);
Arguments : dividend, divisor.
Return value: The result of the division.
Function : 商と余りを同Hourに計算。
Structure: ldiv_t structure, long quot (quotient), long rem (remainder).
Note: We recommend using the operators / and % with this function.
Arguments : dividend, divisor.
Return value: The result of the division.
Function : 商と余りを同Hourに計算。
Structure: ldiv_t structure, long quot (quotient), long rem (remainder).
Note: We recommend using the operators / and % with this function.
rand
function型 : int rand(void);
Return value: a random value.The scope is dependent on the processing system.
Function : random numberを得る。
Usage : #define RANDOM(MIN,MAX) ((MIN)+(int)(rand()/(float)RAND_MAX*((MAX)-(MIN)+1)))
If so, you can obtain a random number between min and max.
Return value: a random value.The scope is dependent on the processing system.
Function : random numberを得る。
Usage : #define RANDOM(MIN,MAX) ((MIN)+(int)(rand()/(float)RAND_MAX*((MAX)-(MIN)+1)))
If so, you can obtain a random number between min and max.
srand
function型 : void srand(unsigned int seed);
Argument: Initial seed value for the random number sequence.
Function : random number系列のInitial valueを与える。
The standard practice is `srand((unsigned int)time(0));`.
Argument: Initial seed value for the random number sequence.
Function : random number系列のInitial valueを与える。
The standard practice is `srand((unsigned int)time(0));`.
exit
function型 : void exit(int n);
Arguments: Exit code.Generally, EXIT_SUCCESS indicates successful termination, while EXIT_FAILURE indicates abnormal termination.
Function : プログラムをEndさせる。
Arguments: Exit code.Generally, EXIT_SUCCESS indicates successful termination, while EXIT_FAILURE indicates abnormal termination.
Function : プログラムをEndさせる。
abort
function型 : void abort(void);
Function : プログラムを異常Endさせる。
Note: Used for exiting in case of an error.
Function : プログラムを異常Endさせる。
Note: Used for exiting in case of an error.
atexit
function型 : int atexit(void (*func)(void));
argument : functionのaddress
Return value: 0 on success, non-zero on failure.
Function : プログラムEndHourにrunするfunctionを登録する。
argument : functionのaddress
Return value: 0 on success, non-zero on failure.
Function : プログラムEndHourにrunするfunctionを登録する。
getenv
function型 : char *getenv(const char *name);
argument : name
Return value: The address of the beginning of the string containing the value.If not found, NULL.
Function : 環境Variableを取得する。
argument : name
Return value: The address of the beginning of the string containing the value.If not found, NULL.
Function : 環境Variableを取得する。
bsearch
function型 : void *bsearch(const void *key, const void *base,size_t nmemb,size_t size, int (*compar)(const void *x, const void *y));
argument : 探すValue、arrayの先頭、探索数、1要素のサイズ、比較functionのaddress
Return value: Address of the found element.If not found, NULL.
Function : 2minute探索を行う。The data must be sorted in ascending order.
比較 : 比較functionは、x > yの場合は正、x = yの場合は0、x < yの場合は負を返すこと。
argument : 探すValue、arrayの先頭、探索数、1要素のサイズ、比較functionのaddress
Return value: Address of the found element.If not found, NULL.
Function : 2minute探索を行う。The data must be sorted in ascending order.
比較 : 比較functionは、x > yの場合は正、x = yの場合は0、x < yの場合は負を返すこと。
qsort
function型 : void qsort(void *base, size_t nel, size_t width,int(*compar)(const void *x, const void *y));
argument : arrayの先頭、整列個数、1要素のサイズ、比較functionのaddress
Function : arrayを昇順に整列する。I often use quicksort.
比較 : 比較functionは、x > yの場合は正、x = yの場合は0、x < yの場合は負を返すこと。
argument : arrayの先頭、整列個数、1要素のサイズ、比較functionのaddress
Function : arrayを昇順に整列する。I often use quicksort.
比較 : 比較functionは、x > yの場合は正、x = yの場合は0、x < yの場合は負を返すこと。
system
function型 : int system(const char *string);
Arguments: Command string.
Return value: System command dependent.Returns -1 if the command failed.
Function : 処理系が用意しているコマンドをrunする。
Note: As expected, commands are incompatible when the processing systems differ.
: NULL is specified, the command returns 0 in environments where the command is unavailable.
Arguments: Command string.
Return value: System command dependent.Returns -1 if the command failed.
Function : 処理系が用意しているコマンドをrunする。
Note: As expected, commands are incompatible when the processing systems differ.
: NULL is specified, the command returns 0 in environments where the command is unavailable.
Character処理
A set of functions for handling single-byte characters.
It's mostly implemented as a macro.
It's mostly implemented as a macro.
isalpha
function型 : int isalpha(int c);
argument : Character
Return a value other than 0 if the character is an alphabet; otherwise, return 0.
Function : Characterがalphabetか判定する。
argument : Character
Return a value other than 0 if the character is an alphabet; otherwise, return 0.
Function : Characterがalphabetか判定する。
isupper
function型 : int isupper(int c);
argument : Character
Return a value other than 0 if the character is an uppercase English letter; otherwise, return 0.
Function : CharacterがCapital lettersか判定する。
argument : Character
Return a value other than 0 if the character is an uppercase English letter; otherwise, return 0.
Function : CharacterがCapital lettersか判定する。
islower
function型 : int islower(int c);
argument : Character
Return: A value other than 0 if the character is a lowercase English letter; otherwise, return 0.
Function : CharacterがEnglish small textか判定する。
argument : Character
Return: A value other than 0 if the character is a lowercase English letter; otherwise, return 0.
Function : CharacterがEnglish small textか判定する。
isdigit
function型 : int isdigit(int c);
argument : Character
Return value: Non-zero if the character is a digit, zero otherwise.
Function : Characterがdigitか判定する。
argument : Character
Return value: Non-zero if the character is a digit, zero otherwise.
Function : Characterがdigitか判定する。
isspace
function型 : int isspace(int c);
argument : Character
Return a non-zero value if the character is a whitespace character; otherwise, return 0.
Function : CharacterがSpaceCharacterか判定する。
argument : Character
Return a non-zero value if the character is a whitespace character; otherwise, return 0.
Function : CharacterがSpaceCharacterか判定する。
isalnum
function型 : int isalnum(int c);
argument : Character
Return: Non-zero if the character is not an alphabet or digit, otherwise 0.
Function : Characterがalphabetまたはdigitか判定する。
argument : Character
Return: Non-zero if the character is not an alphabet or digit, otherwise 0.
Function : Characterがalphabetまたはdigitか判定する。
iscntrl
function型 : int iscntrl(int c);
argument : Character
Return value: A non-zero value if the character is a control character, 0 otherwise.
Function : CharacterがコントロールCharacterか判定する。
argument : Character
Return value: A non-zero value if the character is a control character, 0 otherwise.
Function : CharacterがコントロールCharacterか判定する。
isgraph
function型 : int isgraph(int c);
argument : Character
Return 0 if the character is a printable character other than a space; otherwise, return 0.
Function : CharacterがSpace以外の印刷できるCharacterか判定する。
argument : Character
Return 0 if the character is a printable character other than a space; otherwise, return 0.
Function : CharacterがSpace以外の印刷できるCharacterか判定する。
isprint
function型 : int isprint(int c);
argument : Character
Return: 0 if the character is printable, otherwise 0.
Function : Characterが印刷できるCharacterか判定する。
argument : Character
Return: 0 if the character is printable, otherwise 0.
Function : Characterが印刷できるCharacterか判定する。
ispunct
function型 : int ispunct(int c);
argument : Character
Return value: Non-zero if the character is a delimiter, 0 otherwise.
Function : Characterがdelimiterか判定する。
argument : Character
Return value: Non-zero if the character is a delimiter, 0 otherwise.
Function : Characterがdelimiterか判定する。
isxdigit
function型 : int isxdigit(int c);
argument : Character
Return a non-zero value if the character is a hexadecimal character; otherwise, return zero.
Function : Characterがhexadecimal用のCharacterか判定する。
argument : Character
Return a non-zero value if the character is a hexadecimal character; otherwise, return zero.
Function : Characterがhexadecimal用のCharacterか判定する。
String処理
A collection of functions primarily for string manipulation.
Many functions can also be shared with generic memory processing.
Please note that the reference is based on half-width characters, so be careful when handling full-width characters.
Many functions can also be shared with generic memory processing.
Please note that the reference is based on half-width characters, so be careful when handling full-width characters.
strcpy
function型 : char *strcpy(char *s, const char *t);
argument : Character array、String
Return value : argumentのCharacter arrayをそのまま返す
Function : Character arrayにStringをcopyする。to be used for string assignment.
argument : Character array、String
Return value : argumentのCharacter arrayをそのまま返す
Function : Character arrayにStringをcopyする。to be used for string assignment.
strncpy
function型 : char *strncpy(char *s, const char *t, size_t n);
argument : Character array、String、最大copynumber of characters
Return value: Returns the argument character array as is.
Function : Character arrayに指定number of charactersだけStringをcopyする。
warning : number of charactersが多い場合にはナルCharacterを付加しないので、
必ず、s = '\0'; としてナルCharacterを付加してください。
argument : Character array、String、最大copynumber of characters
Return value: Returns the argument character array as is.
Function : Character arrayに指定number of charactersだけStringをcopyする。
warning : number of charactersが多い場合にはナルCharacterを付加しないので、
必ず、s
strcat
function型 : char *strcat(char *s, const char *t);
argument : Character array、String
Return value : argumentのCharacter arrayをそのまま返す
Function : Character arrayの後ろにStringをつなげる。
argument : Character array、String
Return value : argumentのCharacter arrayをそのまま返す
Function : Character arrayの後ろにStringをつなげる。
strncat
function型 : char *strncat(char *s, const char *t, size_t n);
argument : Character array、String、最大連結number of characters
Return value: Returns the argument character array as is.
Function : Character arrayの後ろに指定number of charactersだけStringをつなげる。
argument : Character array、String、最大連結number of characters
Return value: Returns the argument character array as is.
Function : Character arrayの後ろに指定number of charactersだけStringをつなげる。
strlen
function型 : size_t strlen(const char *s);
argument : String
Return value: The length of the string.Do not include null characters.
Function : Stringの長さを返す。
argument : String
Return value: The length of the string.Do not include null characters.
Function : Stringの長さを返す。
strcmp
function型 : int strcmp(const char *s, const char *t);
argument : String1、String2
Return value: Positive if string1 is greater, 0 if they are equal, negative if string2 is greater.
Function : String1とString2を比較する。
argument : String1、String2
Return value: Positive if string1 is greater, 0 if they are equal, negative if string2 is greater.
Function : String1とString2を比較する。
strncmp
function型 : int strncmp(const char *s, const char *t, size_t n);
argument : String1、String2、比較number of characters
Return value: Positive if string1 is greater, 0 if they are equal, negative if string2 is greater.
Function : Stringを指定number of charactersだけ比較する。
argument : String1、String2、比較number of characters
Return value: Positive if string1 is greater, 0 if they are equal, negative if string2 is greater.
Function : Stringを指定number of charactersだけ比較する。
strchr
function型 : char *strchr(const char *s, int c);
argument : String、Character
Return value: The address of the found location, or NULL if not found.
Function : Stringの先頭FromCharacterをSearchする。
argument : String、Character
Return value: The address of the found location, or NULL if not found.
Function : Stringの先頭FromCharacterをSearchする。
strrchr
function型 : char *strrchr(const char *s, int c);
argument : String、Character
Return value: The address of the found location, or NULL if not found.
Function : Stringの後ろFromCharacterをSearchする。
argument : String、Character
Return value: The address of the found location, or NULL if not found.
Function : Stringの後ろFromCharacterをSearchする。
strcspn
function型 : size_t strcspn(const char *s, const char *t);
argument : 対象String、SearchString
Return value: The number of characters to the found position.
Function : 対象Stringの中FromSearchStringに含まれるCharacterをSearchする。
argument : 対象String、SearchString
Return value: The number of characters to the found position.
Function : 対象Stringの中FromSearchStringに含まれるCharacterをSearchする。
strspn
function型 : size_t strspn(const char *s, const char *t);
argument : 対象String、SearchString
Return value: Number of characters to the not found position.
Function : 対象Stringの中FromSearchStringに含まれないCharacterをSearchする。
argument : 対象String、SearchString
Return value: Number of characters to the not found position.
Function : 対象Stringの中FromSearchStringに含まれないCharacterをSearchする。
strpbrk
function型 : char *strpbrk(const char *s, const char *t);
argument : 対象String、SearchString
Return value: pointer to the first character found, or NULL if not found.
Function : 対象Stringの先頭FromSearchStringに含まれるCharacterをSearchする。
argument : 対象String、SearchString
Return value: pointer to the first character found, or NULL if not found.
Function : 対象Stringの先頭FromSearchStringに含まれるCharacterをSearchする。
strstr
function型 : char *strstr(const char *s, const char *t);
argument : 対象String、SearchString
Return value: Pointer to the found location, or NULL if not found.
Function : 対象StringFromSearchStringをSearchする。
argument : 対象String、SearchString
Return value: Pointer to the found location, or NULL if not found.
Function : 対象StringFromSearchStringをSearchする。
strtok
function型 : char *strtok(char *s, const char *t);
argument : Character array、delimiter列
Return value: A pointer to the tokenized word.If not found, NULL.
Function : Character arrayを、delimiter列に含まれるCharacterがある位置で区切る。
Calling the function with a null character array allows you to retrieve the next word.
argument : Character array、delimiter列
Return value: A pointer to the tokenized word.If not found, NULL.
Function : Character arrayを、delimiter列に含まれるCharacterがある位置で区切る。
Calling the function with a null character array allows you to retrieve the next word.
strerror
function型 : char *strerror(int n);
argument : ErrorNumber
Return value: An array containing the error message.An empty string if no corresponding error exists.
Function : ErrorMessageを取得する。
Caution: Do not modify the contents of the obtained array.
argument : ErrorNumber
Return value: An array containing the error message.An empty string if no corresponding error exists.
Function : ErrorMessageを取得する。
Caution: Do not modify the contents of the obtained array.
memcpy
function型 : void *memcpy(void *dest, const void *source, size_t count);
argument : copy先、copy元、copyサイズ
Return value : argumentのcopy先を返す
Function : メモリ内容をcopyする。It doesn't work when the copy areas overlap.
argument : copy先、copy元、copyサイズ
Return value : argumentのcopy先を返す
Function : メモリ内容をcopyする。It doesn't work when the copy areas overlap.
memmove
function型 : void *memmove(void *dest, const void *source, size_t count);
argument : copy先、copy元、copyサイズ
Return value : argumentのcopy先を返す
Function : メモリ内容をcopyする。Overlapping copy areas are acceptable.
Note: Despite the name move, it does not refer to movement, so please be aware.
argument : copy先、copy元、copyサイズ
Return value : argumentのcopy先を返す
Function : メモリ内容をcopyする。Overlapping copy areas are acceptable.
Note: Despite the name move, it does not refer to movement, so please be aware.
memset
function型 : void *memset(void *addr, int byte, size_t count);
argument : array、numerics、Assignmentサイズ
Return value : argumentのarrayをそのまま返す
Function : メモリ内容の指定サイズminuteの要素すべてにnumericsをAssignment。Can also be used for characters.
argument : array、numerics、Assignmentサイズ
Return value : argumentのarrayをそのまま返す
Function : メモリ内容の指定サイズminuteの要素すべてにnumericsをAssignment。Can also be used for characters.
memcmp
function型 : int memcmp(const void *addr1, const void *addr2, size_t n);
argument : array1、array2、比較サイズ
Return value: Positive if array1 is greater, zero if they are equal, negative if array2 is greater.
Function : メモリ同士を比較する。It can also compare strings.
argument : array1、array2、比較サイズ
Return value: Positive if array1 is greater, zero if they are equal, negative if array2 is greater.
Function : メモリ同士を比較する。It can also compare strings.
memchr
function型 : void *memchr(const void *addr, int byte, size_t count);
argument : array、1バイトのnumerics、Searchするサイズ
Return value: The address of the found location, or NULL if not found.
Function : メモリ内FromnumericsをSearchする。Works even for single-character searches.
argument : array、1バイトのnumerics、Searchするサイズ
Return value: The address of the found location, or NULL if not found.
Function : メモリ内FromnumericsをSearchする。Works even for single-character searches.
数学function
A suite of basic mathematical functions.
Please note that the angle is expressed in radians.
The conversion from degrees to radians is as follows.
radians = (degrees * 3.14159 / 180)
Please note that the angle is expressed in radians.
The conversion from degrees to radians is as follows.
radians = (degrees * 3.14159 / 180)
fabs
function型 : double fabs(double x);
argument : 実numerics
Return value : absolute value
Function : absolute valueを計算する。
argument : 実numerics
Return value : absolute value
Function : absolute valueを計算する。
sqrt
function型 : double sqrt(double x);
argument : 任意の実numerics
Return value : square root
Function : square rootを計算する
argument : 任意の実numerics
Return value : square root
Function : square rootを計算する
pow
function型 : double pow(double x, double y);
argument : exponentされるValue、指数
Return value : x を y 乗したValue
Function : exponentを求める。
argument : exponentされるValue、指数
Return value : x を y 乗したValue
Function : exponentを求める。
fmod
function型 : double fmod(double x, double y);
argument : 割られる数、割る数
Return value : 余り
Function : 実numericsの余りを求める。
argument : 割られる数、割る数
Return value : 余り
Function : 実numericsの余りを求める。
sin
function型 : double sin(double x);
argument : radians単位の角度
Return value : sineValue
Function : sineを計算する
argument : radians単位の角度
Return value : sineValue
Function : sineを計算する
cos
function型 : double cos(double x);
argument : radians単位の角度
Return value : cosineValue
Function : cosineを計算する
argument : radians単位の角度
Return value : cosineValue
Function : cosineを計算する
tan
function型 : double tan(double x);
argument : radians単位の角度
Return value : tangentValue
Function : tangentを計算する
argument : radians単位の角度
Return value : tangentValue
Function : tangentを計算する
acos
function型 : double acos(double x);
argument : cosineのValue
Return value : arc cosine(radians)Value
Function : arc cosineを計算する
argument : cosineのValue
Return value : arc cosine(radians)Value
Function : arc cosineを計算する
asin
function型 : double asin(double x);
argument : sineのValue
Return value : arc sine(radians)Value
Function : arc sineを計算する
argument : sineのValue
Return value : arc sine(radians)Value
Function : arc sineを計算する
atan
function型 : double atan(double x);
argument : tangentのValue
Return value : arc tangent(radians)Value
Function : arc tangentを計算する。
The value will be in the range of π/2.
argument : tangentのValue
Return value : arc tangent(radians)Value
Function : arc tangentを計算する。
The value will be in the range of π/2.
atan2
function型 : double atan2(double y, double x);
argument : 縦のValue、横のValue
Return value : arc tangent(radians)Value
Function : arc tangentを計算する。
The value will be within the range of π, and the calculation can be performed even when the argument x is 0.
argument : 縦のValue、横のValue
Return value : arc tangent(radians)Value
Function : arc tangentを計算する。
The value will be within the range of π, and the calculation can be performed even when the argument x is 0.
sinh
function型 : double sinh(double x);
argument : radians単位の角度
Return value : ハイパボリックsineValue
Function : ハイパボリックsineValueを計算する
(exp(x) - exp(-x)) / 2
argument : radians単位の角度
Return value : ハイパボリックsineValue
Function : ハイパボリックsineValueを計算する
(exp(x) - exp(-x)) / 2
cosh
function型 : double cosh(double x);
argument : radians単位の角度
Return value : ハイパボリックcosineValue
Function : ハイパボリックcosineValueを計算する
The same as (exp(x) + exp(-x)) / 2.
argument : radians単位の角度
Return value : ハイパボリックcosineValue
Function : ハイパボリックcosineValueを計算する
The same as (exp(x) + exp(-x)) / 2.
tanh
function型 : double tanh(double x);
argument : radians単位の角度
Return value : ハイパボリックtangentValue
Function : ハイパボリックtangentValueを計算する
sinh(x) / cosh(x)
argument : radians単位の角度
Return value : ハイパボリックtangentValue
Function : ハイパボリックtangentValueを計算する
sinh(x) / cosh(x)
ceil
function型 : double ceil(double x);
argument : 任意の実numerics
Return value : Input value以上の整numerics
Function : 実numericsを整numericsに丸める。
argument : 任意の実numerics
Return value : Input value以上の整numerics
Function : 実numericsを整numericsに丸める。
floor
function型 : double floor(double x);
argument : 任意の実numerics
Return value : Input value以下の整numerics
Function : 実numericsを整numericsに丸める。
argument : 任意の実numerics
Return value : Input value以下の整numerics
Function : 実numericsを整numericsに丸める。
exp
function型 : double exp(double x);
argument : 実numerics
Return value : 自然対数の底のx乗
Function : 指数を計算する。
argument : 実numerics
Return value : 自然対数の底のx乗
Function : 指数を計算する。
log
function型 : double log(double x);
argument : 任意の実numerics
Return value : 自然対numerics
Function : 自然対数を求める。
argument : 任意の実numerics
Return value : 自然対numerics
Function : 自然対数を求める。
log10
function型 : double log10(double x);
argument : 任意の実numerics
Return value : 常用対numerics
Function : 常用対数を求める。
argument : 任意の実numerics
Return value : 常用対numerics
Function : 常用対数を求める。
modf
function型 : double modf(double x, double *ip);
argument : 任意の実numerics、返されるInteger部部minuteのValue
Return value : 小数部minuteのValue
Function : 実numericsをInteger部minuteと小数部minuteにminuteける。
argument : 任意の実numerics、返されるInteger部部minuteのValue
Return value : 小数部minuteのValue
Function : 実numericsをInteger部minuteと小数部minuteにminuteける。
frexp
function型 : double frexp(double x, int *p);
argument : 任意の実numerics、返される指数部minuteのValue
Return value : 仮数部minuteのValue
Function : Floating-pointValueの指数部と仮数部を求める
argument : 任意の実numerics、返される指数部minuteのValue
Return value : 仮数部minuteのValue
Function : Floating-pointValueの指数部と仮数部を求める
ldexp
function型 : double ldexp(double x, int p);
argument : 仮数部、指数部
Return value : 合成されたFloating-pointValue
Function : 仮数部と指数部FromFloating-pointValueを求める。
argument : 仮数部、指数部
Return value : 合成されたFloating-pointValue
Function : 仮数部と指数部FromFloating-pointValueを求める。
Hours
A suite of functions for handling time.These functions are from UNIX conventions.
Based on 00:00:00 Coordinated Universal Time (UTC) on January 1, 1970.
Moving forward, we will refer to January 1, 1970, 00:00:00 as the reference time in all documentation.
Based on 00:00:00 Coordinated Universal Time (UTC) on January 1, 1970.
Moving forward, we will refer to January 1, 1970, 00:00:00 as the reference time in all documentation.
time
function型 : time_t time(time_t *t);
argument : Timeを格納するVariableのaddress
Return value : 基準TimeFromのprogressSec数
Function : 現在のTimeを基準TimeFromのprogressSec数で返す。
Note: It can be called with NULL arguments and only the return value is retrieved.Depending on the context, units other than seconds may be used.
argument : Timeを格納するVariableのaddress
Return value : 基準TimeFromのprogressSec数
Function : 現在のTimeを基準TimeFromのprogressSec数で返す。
Note: It can be called with NULL arguments and only the return value is retrieved.Depending on the context, units other than seconds may be used.
clock
function型 : clock_t clock(void);
argument : None
Return value : 使用プロセスHours
Function : プログラムが使用したプロセスHoursを返す。
Note: You can obtain a value in seconds by using clock() / CLOCKS_PER_SEC.
Warning: May not match elapsed time in multithreaded environments.
argument : None
Return value : 使用プロセスHours
Function : プログラムが使用したプロセスHoursを返す。
Note: You can obtain a value in seconds by using clock() / CLOCKS_PER_SEC.
Warning: May not match elapsed time in multithreaded environments.
difftime
function型 : double difftime(time_t t1, time_t t2);
argument : 基準TimeFromのprogressSec数1、基準TimeFromのprogressSec数2
Return value : 2つのprogressSec数の差
Function : Timeの引き算をするDepending on the context, units other than seconds may be used.
argument : 基準TimeFromのprogressSec数1、基準TimeFromのprogressSec数2
Return value : 2つのprogressSec数の差
Function : Timeの引き算をするDepending on the context, units other than seconds may be used.
localtime
function型 : struct tm *localtime(const time_t *t);
argument : 基準TimeFromのprogressSec数
Return value : Sec数を国内Time情報に変換したstruct
Function : 基準TimeFromのprogressSec数を国内Timeに変換する。
Caution: The return value is a shared memory area across the entire system,It is essential to copy it to a separate structure as declared beforehand.
argument : 基準TimeFromのprogressSec数
Return value : Sec数を国内Time情報に変換したstruct
Function : 基準TimeFromのprogressSec数を国内Timeに変換する。
Caution: The return value is a shared memory area across the entire system,It is essential to copy it to a separate structure as declared beforehand.
gmtime
function型 : struct tm *gmtime(const time_t *t);
argument : 基準TimeFromのprogressSec数
Return value : Sec数を国際Time情報に変換したstruct
Function : 基準TimeFromのprogressSec数を国際Timeに変換する。
Caution: The return value is a shared memory area across the entire system,It is essential to copy it to a separate structure as declared beforehand.
argument : 基準TimeFromのprogressSec数
Return value : Sec数を国際Time情報に変換したstruct
Function : 基準TimeFromのprogressSec数を国際Timeに変換する。
Caution: The return value is a shared memory area across the entire system,It is essential to copy it to a separate structure as declared beforehand.
asctime
function型 : char *asctime(const struct tm *tm);
argument : Timeを格納したstruct
Return value : Timeを変換したStringの先頭address
Function : Timeを Wed Feb 17 20:14:04 1988 のようなStringに変換する。
Caution: The return value is a shared memory area across the entire system,It is essential to copy it to a separate structure as declared beforehand.
argument : Timeを格納したstruct
Return value : Timeを変換したStringの先頭address
Function : Timeを Wed Feb 17 20:14:04 1988 のようなStringに変換する。
Caution: The return value is a shared memory area across the entire system,It is essential to copy it to a separate structure as declared beforehand.
ctime
function型 : char *ctime(const time_t *t);
argument : 基準TimeFromのprogressSec数
Return value : Timeを変換したStringの先頭address
Function : Timeを Wed Feb 17 20:14:04 1988 のようなStringに変換する。
Caution: The return value is a shared memory area across the entire system,It is essential to copy it to a separate structure as declared beforehand.
argument : 基準TimeFromのprogressSec数
Return value : Timeを変換したStringの先頭address
Function : Timeを Wed Feb 17 20:14:04 1988 のようなStringに変換する。
Caution: The return value is a shared memory area across the entire system,It is essential to copy it to a separate structure as declared beforehand.
strftime
function型 : size_t strftime(char *s, size_t smax, const char *fmt, const struct tm *tp);
argument : Character array、Character arrayのサイズ、TimeFormat指定String、Timeを格納したstruct
Return value: The number of characters written to the array.0 if it fails.
Function : Timeを指定されたFormat通りにStringに変換する。
argument : Character array、Character arrayのサイズ、TimeFormat指定String、Timeを格納したstruct
Return value: The number of characters written to the array.0 if it fails.
Function : Timeを指定されたFormat通りにStringに変換する。
control
A set of functions primarily responsible for program control.
These each have different header files.
These each have different header files.
<assert.h> を必要とするfunction群
assert
function型 : void assert(int expression);
argument : 診断する変numerics
Return value : None
Function : デバッグのために診断を行う。
Note: If the value set as an argument is 0,Terminates abruptly, displaying the name of the source file and line number.If the NDEBUG constant is defined, it will be removed during compilation.
argument : 診断する変numerics
Return value : None
Function : デバッグのために診断を行う。
Note: If the value set as an argument is 0,Terminates abruptly, displaying the name of the source file and line number.If the NDEBUG constant is defined, it will be removed during compilation.
<signal.h> を必要とするfunction群
raise
function型 : int raise(int sig);
argument : 送信するシグナルValue
Return value: 0 on success, non-zero on failure.
Function : プログラムにシグナルを送信する。
argument : 送信するシグナルValue
Return value: 0 on success, non-zero on failure.
Function : プログラムにシグナルを送信する。
signal
function型 : void (*signal(int sig, void (*handler)()))();
argument : SettingsするシグナルValue、シグナルを処理するfunctionのaddress
Return value: The address of the previously set function, or SIG_ERR on failure.
Function : シグナルを処理するfunctionをSettingsする。
argument : SettingsするシグナルValue、シグナルを処理するfunctionのaddress
Return value: The address of the previously set function, or SIG_ERR on failure.
Function : シグナルを処理するfunctionをSettingsする。
<setjmp.h> を必要とするfunction群
setjmp
function型 : int setjmp(jmp_buf env);
argument : ジャンプ先の状態を格納するVariableのaddress
Return value: 0 when first called, the value when returning via longjmp.
Function : longjmpfunctionに備えて状態をSaveする。
Warning: This is a malicious function guaranteed to wreak havoc on program flow.Unless there's a compelling reason, don't use it.
argument : ジャンプ先の状態を格納するVariableのaddress
Return value: 0 when first called, the value when returning via longjmp.
Function : longjmpfunctionに備えて状態をSaveする。
Warning: This is a malicious function guaranteed to wreak havoc on program flow.Unless there's a compelling reason, don't use it.
longjmp
function型 : void longjmp(jmp_buf env, int val);
argument : ジャンプ先の状態が格納されたVariableのaddress、任意のReturn value
Return value : None
Function : function間をまたぐ広域ジャンプを行う
Warning: This is a malicious function guaranteed to wreak havoc on program flow.Unless there's a compelling reason, don't use it.
argument : ジャンプ先の状態が格納されたVariableのaddress、任意のReturn value
Return value : None
Function : function間をまたぐ広域ジャンプを行う
Warning: This is a malicious function guaranteed to wreak havoc on program flow.Unless there's a compelling reason, don't use it.
About This Site
Learning C language through suffering (Kushi C) isThis is the definitive introduction to the C language.
It systematically explains the basic functions of the C language.
The quality is equal to or higher than commercially available books.




