MMGameslogo  MMGames
TwitterSharebutton  FacebookSharebutton   
learn through sufferingC Language
learn through sufferingC Language

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.

designated file pointer
stdin 標準入力(普通はキーボード)
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  : File名、モード文字列
Return value: Opened file pointer.NULL on failure.
機能  : Fileを開く。
Mode: r read, w new, a append."b-suffix for binary, + suffix for input/output."


fclose
function型 : int fclose(FILE *fp);
argument  : FilePointer
return value : 成功した場合は0、失敗したときはEOF
機能  : Fileを閉じる。


fgetc
function型 : int fgetc(FILE *fp);
argument  : FilePointer
Return value: The character read."Failure or end of file (EOF)."
機能  : Fileから1文字読み出す。


getc
機能  : fgetcとまったく同じ。
Caution: May contain macros, so be aware of potential side effects.


fgets
function型 : char *fgets(char *s, int n, FILE *fp);
argument  : 文字列を格納するバッファ、バッファサイズ、FilePointer
Return value: The buffer specified as an argument.NULL if failed or reached the end.
機能  : Fileから1行読み出す。The result includes a line break.


fputc
function型 : int fputc(int c, FILE *fp);
argument  : 文字、FilePointer
Return value: output character.When it fails, EOF.
機能  : Fileに1文字書き込む。


putc
機能  : fputcとまったく同じ。
Caution: May contain macros, so be aware of potential side effects.


fputs
function型 : int fputs(const char *s, FILE *fp);
argument  : 文字列、FilePointer
Return value: True on success, EOF on failure.
機能  : Fileに文字列を書き込む。


fread
function型 : size_t fread(void *ptr, size_t size, size_t nelem, FILE *fp);
argument  : 読み込み結果を格納するバッファ、1項目のサイズ、項目数、FilePointer
Return value: The number of items read.0 if it fails.
機能  : Fileから固定サイズの項目を読み込む。


fwrite
function型 : size_t fwrite(const void *ptr, size_t size, size_t nelem, FILE *fp);
argument  : 書き込むバッファ、1項目のサイズ、項目数、FilePointer
Return value: The number of items written.0 if it fails.
機能  : Fileに固定サイズの項目を書き込む。


fprintf
function型 : int fprintf(FILE *fp, const char *format, ...);
argument  : FilePointer、書式付き文字列、可変個のvariable
Return value: Number of characters output."Negative value when failed."
機能  : Fileに書式付き文字列を書き込む。


fscanf
function型 : int fscanf(FILE *fp, const char *format, ...);
argument  : FilePointer、変換指定文字列、可変個のバッファ
Return value: The number of conversions that succeeded."-1 if failed."
機能  : Fileから文字列を読み込み指定されたFormatに変換する。


ftell
function型 : long ftell(FILE *fp);
argument  : FilePointer
Return value: The current file position.
機能  : File位置を取得する。


fseek
function型 : int fseek(FILE *fp, long offset, int ptrname);
argument  : FilePointer、File位置の移動数、File位置の基準
Return value: 0 on success, non-zero on failure.
機能  : File位置を変更する。
Position : SEEK_SET beginning, SEEK_CUR current position, SEEK_END end.


fgetpos
function型 : int fgetpos(FILE *fp, fpos_t *ptr);
argument  : FilePointer、File位置を格納するvariableのPointer
Return value: 0 on success, non-zero on failure.機能  : 現在のFile位置を格納する。


fsetpos
function型 : int fsetpos(FILE *fp, const fpos_t *ptr);argument  : FilePointer、File位置を格納するvariableのPointer
Return value: 0 on success, non-zero on failure.
機能  : File位置を変更する。


feof
function型 : int feof(FILE *fp);
argument  : FilePointer
Return value: True if the end is reached, false otherwise.
機能  : Fileが終わりに到達したか調べる。


ferror
function型 : int ferror(FILE *fp);
argument  : FilePointer
Return value: True if an error occurred, false otherwise.
機能  : FileにErrorが発生したか調べる。


clearerr
function型 : void clearerr(FILE *fp);
argument  : FilePointer
機能  : FileのErrorのHourに回復する。


fflush
function型 : int fflush(FILE *fp);
argument  : FilePointer
Return value: 0 on success, false on failure.
機能  : 出力バッファを強制出力する。
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  : File名、モード文字列、FilePointer
Return value: The file pointer specified as an argument.NULL on failure.
機能  : FilePointerのAgain割り当て。


rename
function型 : int rename(const char *oldname, const char *newname);
argument  : 現在のFile名、新しいFile名
Return value: 0 on success, non-zero on failure.
機能  : Fileの名前を変更する。


remove
function型 : int remove(const char *filename);
argument  : File名
Return value: 0 on success, non-zero on failure.
機能  : Fileを削除する。


getchar
function型 : int getchar(void);
Return value: The character read.If it fails, EOF.
機能  : 標準入力(キーボード)から1文字読み込む。


putchar
function型 : int putchar(char c);
argument  : 文字
Return value: output character.When it fails, EOF.
機能  : 標準出力(ディスプレイ)に1文字書き込む。


gets
function型 : char *gets(char *s);
argument  : 読み込んだ文字列を格納するバッファ
Return value: The buffer specified as an argument.NULL if failed or reached the end.
機能  : 標準入力(キーボード)から1行読み出す。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  : 文字列
Return value: 0 on success, non-zero on failure.
機能  : 標準出力(ディスプレイ)に1行書き込む。It will be wrapped.


perror
function型 : void perror(const char *s);
argument  : 表示する文字列
機能  : 指定した文字列と一緒に直前に発生したErrorを表示する。


printf
function型 : int printf(const char *format, ...);
argument  : 書式付き文字列、可変個のvariable
Return value: Number of characters output."Failure: -1."
機能  : 標準出力(ディスプレイ)に書式付き文字列を書き込む。


scanf
function型 : int scanf(const char *format, ...);
argument  : 変換指定文字列、可変個のバッファ
Return value: The number of conversions that succeeded."-1 if failed."
機能  : 標準入力(キーボード)から文字列を読み込み指定された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.


malloc
function型 : void *malloc(size_t n);
argument  : 確保するメモリサイズ
Return value: The address of the allocated memory.If not secured, NULL.
機能  : メモリを動的に確保する。


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.
機能  : メモリを動的に確保する。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.
機能  : 確保したメモリサイズを変更する。The content will be preserved.
Please note that the memory address may change.


free
function型 : void free(void *p);
argument  : 確保したメモリのaddress
機能  : 動的に確保したメモリを解放。


abs
function型 : int abs(int n);
argument  : numerics
return value : numericsのabsolute value
機能  : absolute valueを求める。


labs
function型 : long labs(long n);
argument  : numerics
return value : numericsのabsolute value
機能  : absolute valueを求める。


atof
function型 : double atof(const char *s);
argument  : digitをInclude文字列
Return value: The transformed value."0 if not convertible."
機能  : digitをInclude文字列を実numericsに変換。


atoi
function型 : int atoi(const char *s);
argument  : digitをInclude文字列
Return value: The transformed value."0 if not convertible."
機能  : digitをInclude文字列を整numericsに変換。


atol
function型 : long atol(const char *s);
argument  : digitをInclude文字列
Return value: The transformed value."0 if not convertible."
機能  : digitをInclude文字列を整numericsに変換。


strtod
function型 : double strtod(const char *s, char **endptr);
argument  : digitをInclude文字列、終了位置のaddress
Return value: The transformed value."0 if not convertible."
機能  : digitをInclude文字列を実numericsに変換。


strtol
function型 : long strtol(const char *s, char **endptr, int base);
argument  : digitをInclude文字列、終了位置のaddress、numericsの基数(binary digitsやhexadecimal)
Return value: The transformed value."0 if not convertible."
機能  : digitをInclude文字列を整numericsに変換。


strtoul
function型 : unsigned long strtoul(const char *s, char **endptr, int base);
argument  : digitをInclude文字列、終了位置のaddress、numericsの基数(binary digitsやhexadecimal)
Return value: The transformed value."0 if not convertible."
機能  : digitをInclude文字列を符号無し整numericsに変換。


div
function型 : div_t div(int num, int denom);
Arguments : dividend, divisor.
Return value: The result of the division.
機能  : 商と余りを同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.
機能  : 商と余りを同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.
機能  : random numberを得る。
使用法 : #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.
機能  : random number系列の初期値を与える。
"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.
機能  : プログラムを終了させる。


abort
function型 : void abort(void);
機能  : プログラムを異常終了させる。
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.
機能  : プログラム終了Hourにrunするfunctionを登録する。


getenv
function型 : char *getenv(const char *name);
argument  : 名前
Return value: The address of the beginning of the string containing the value.If not found, NULL.
機能  : 環境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  : 探す値、arrayの先頭、探索数、1要素のサイズ、比較functionのaddress
Return value: Address of the found element.If not found, NULL.
機能  : 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
機能  : 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."
機能  : 処理系が用意しているコマンドを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."


文字処理
A set of functions for handling single-byte characters.
It's mostly implemented as a macro.


isalpha
function型 : int isalpha(int c);
argument  : 文字
Return a value other than 0 if the character is an alphabet; otherwise, return 0.
機能  : 文字がalphabetか判定する。


isupper
function型 : int isupper(int c);
argument  : 文字
Return a value other than 0 if the character is an uppercase English letter; otherwise, return 0.
機能  : 文字が英大文字か判定する。


islower
function型 : int islower(int c);
argument  : 文字
Return: A value other than 0 if the character is a lowercase English letter; otherwise, return 0.
機能  : 文字が英小文字か判定する。


isdigit
function型 : int isdigit(int c);
argument  : 文字
Return value: Non-zero if the character is a digit, zero otherwise.
機能  : 文字がdigitか判定する。


isspace
function型 : int isspace(int c);
argument  : 文字
Return a non-zero value if the character is a whitespace character; otherwise, return 0.
機能  : 文字がSpace文字か判定する。


isalnum
function型 : int isalnum(int c);
argument  : 文字
Return: Non-zero if the character is not an alphabet or digit, otherwise 0.
機能  : 文字がalphabetまたはdigitか判定する。


iscntrl
function型 : int iscntrl(int c);
argument  : 文字
Return value: A non-zero value if the character is a control character, 0 otherwise.
機能  : 文字がコントロール文字か判定する。


isgraph
function型 : int isgraph(int c);
argument  : 文字
Return 0 if the character is a printable character other than a space; otherwise, return 0.
機能  : 文字がスペース以外の印刷できる文字か判定する。


isprint
function型 : int isprint(int c);
argument  : 文字
Return: 0 if the character is printable, otherwise 0.
機能  : 文字が印刷できる文字か判定する。


ispunct
function型 : int ispunct(int c);
argument  : 文字
Return value: Non-zero if the character is a delimiter, 0 otherwise.
機能  : 文字が区切り文字か判定する。


isxdigit
function型 : int isxdigit(int c);
argument  : 文字
Return a non-zero value if the character is a hexadecimal character; otherwise, return zero.
機能  : 文字がhexadecimal用の文字か判定する。

文字列処理
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.


strcpy
function型 : char *strcpy(char *s, const char *t);
argument  : 文字array、文字列
return value : argumentの文字arrayをそのまま返す
機能  : 文字arrayに文字列をcopyする。to be used for string assignment.


strncpy
function型 : char *strncpy(char *s, const char *t, size_t n);
argument  : 文字array、文字列、最大copynumber of characters
Return value: Returns the argument character array as is.
機能  : 文字arrayに指定number of charactersだけ文字列をcopyする。
Caution  : number of charactersが多い場合にはナル文字を付加しないので、
必ず、s = '\0'; としてナル文字を付加してください。


strcat
function型 : char *strcat(char *s, const char *t);
argument  : 文字array、文字列
return value : argumentの文字arrayをそのまま返す
機能  : 文字arrayの後ろに文字列をつなげる。


strncat
function型 : char *strncat(char *s, const char *t, size_t n);
argument  : 文字array、文字列、最大連結number of characters
Return value: Returns the argument character array as is.
機能  : 文字arrayの後ろに指定number of charactersだけ文字列をつなげる。


strlen
function型 : size_t strlen(const char *s);
argument  : 文字列
Return value: The length of the string.Do not include null characters.
機能  : 文字列の長さを返す。


strcmp
function型 : int strcmp(const char *s, const char *t);
argument  : 文字列1、文字列2
Return value: Positive if string1 is greater, 0 if they are equal, negative if string2 is greater.
機能  : 文字列1と文字列2を比較する。


strncmp
function型 : int strncmp(const char *s, const char *t, size_t n);
argument  : 文字列1、文字列2、比較number of characters
Return value: Positive if string1 is greater, 0 if they are equal, negative if string2 is greater.
機能  : 文字列を指定number of charactersだけ比較する。


strchr
function型 : char *strchr(const char *s, int c);
argument  : 文字列、文字
Return value: The address of the found location, or NULL if not found.
機能  : 文字列の先頭から文字を検索する。


strrchr
function型 : char *strrchr(const char *s, int c);
argument  : 文字列、文字
Return value: The address of the found location, or NULL if not found.
機能  : 文字列の後ろから文字を検索する。


strcspn
function型 : size_t strcspn(const char *s, const char *t);
argument  : 対象文字列、検索文字列
Return value: The number of characters to the found position.
機能  : 対象文字列の中から検索文字列に含まれる文字を検索する。


strspn
function型 : size_t strspn(const char *s, const char *t);
argument  : 対象文字列、検索文字列
Return value: Number of characters to the not found position.
機能  : 対象文字列の中から検索文字列に含まれない文字を検索する。


strpbrk
function型 : char *strpbrk(const char *s, const char *t);
argument  : 対象文字列、検索文字列
Return value: pointer to the first character found, or NULL if not found.
機能  : 対象文字列の先頭から検索文字列に含まれる文字を検索する。


strstr
function型 : char *strstr(const char *s, const char *t);
argument  : 対象文字列、検索文字列
Return value: Pointer to the found location, or NULL if not found.
機能  : 対象文字列から検索文字列を検索する。


strtok
function型 : char *strtok(char *s, const char *t);
argument  : 文字array、区切り文字列
Return value: A pointer to the tokenized word.If not found, NULL.
機能  : 文字arrayを、区切り文字列に含まれる文字がある位置で区切る。
Calling the function with a null character array allows you to retrieve the next word.


strerror
function型 : char *strerror(int n);
argument  : Error番号
Return value: An array containing the error message.An empty string if no corresponding error exists.
機能  : Errorメッセージを取得する。
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先を返す
機能  : メモリ内容を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先を返す
機能  : メモリ内容を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をそのまま返す
機能  : メモリ内容の指定サイズ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.
機能  : メモリ同士を比較する。"It can also compare strings."


memchr
function型 : void *memchr(const void *addr, int byte, size_t count);
argument  : array、1バイトのnumerics、検索するサイズ
Return value: The address of the found location, or NULL if not found.
機能  : メモリ内からnumericsを検索する。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)


fabs
function型 : double fabs(double x);
argument  : 実numerics
return value : absolute value
機能  : absolute valueを計算する。


sqrt
function型 : double sqrt(double x);
argument  : 任意の実numerics
return value : square root
機能  : square rootを計算する


pow
function型 : double pow(double x, double y);
argument  : exponentされる値、指数
return value : x を y 乗した値
機能  : exponentを求める。


fmod
function型 : double fmod(double x, double y);
argument  : 割られる数、割る数
return value : 余り
機能  : 実numericsの余りを求める。


sin
function型 : double sin(double x);
argument  : radians単位の角度
return value : サイン値
機能  : サインを計算する


cos
function型 : double cos(double x);
argument  : radians単位の角度
return value : コサイン値
機能  : コサインを計算する


tan
function型 : double tan(double x);
argument  : radians単位の角度
return value : タンジェント値
機能  : タンジェントを計算する


acos
function型 : double acos(double x);
argument  : コサインの値
return value : アークコサイン(radians)値
機能  : アークコサインを計算する


asin
function型 : double asin(double x);
argument  : サインの値
return value : アークサイン(radians)値
機能  : アークサインを計算する


atan
function型 : double atan(double x);
argument  : タンジェントの値
return value : アークタンジェント(radians)値
機能  : アークタンジェントを計算する。
The value will be in the range of π/2.


atan2
function型 : double atan2(double y, double x);
argument  : 縦の値、横の値
return value : アークタンジェント(radians)値
機能  : アークタンジェントを計算する。
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 : ハイパボリックサイン値
機能  : ハイパボリックサイン値を計算する
"(exp(x) - exp(-x)) / 2"


cosh
function型 : double cosh(double x);
argument  : radians単位の角度
return value : ハイパボリックコサイン値
機能  : ハイパボリックコサイン値を計算する
The same as (exp(x) + exp(-x)) / 2.


tanh
function型 : double tanh(double x);
argument  : radians単位の角度
return value : ハイパボリックタンジェント値
機能  : ハイパボリックタンジェント値を計算する
sinh(x) / cosh(x)


ceil
function型 : double ceil(double x);
argument  : 任意の実numerics
return value : 入力値以上の整numerics
機能  : 実numericsを整numericsに丸める。


floor
function型 : double floor(double x);
argument  : 任意の実numerics
return value : 入力値以下の整numerics
機能  : 実numericsを整numericsに丸める。


exp
function型 : double exp(double x);
argument  : 実numerics
return value : 自然対数の底のx乗
機能  : 指数を計算する。


log
function型 : double log(double x);
argument  : 任意の実numerics
return value : 自然対numerics
機能  : 自然対数を求める。


log10
function型 : double log10(double x);
argument  : 任意の実numerics
return value : 常用対numerics
機能  : 常用対数を求める。


modf
function型 : double modf(double x, double *ip);
argument  : 任意の実numerics、返される整数部部minuteの値
return value : 小数部minuteの値
機能  : 実numericsを整数部minuteと小数部minuteにminuteける。


frexp
function型 : double frexp(double x, int *p);
argument  : 任意の実numerics、返される指数部minuteの値
return value : 仮数部minuteの値
機能  : Floating-point値の指数部と仮数部を求める


ldexp
function型 : double ldexp(double x, int p);
argument  : 仮数部、指数部
return value : 合成されたFloating-point値
機能  : 仮数部と指数部からFloating-point値を求める。


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.


time
function型 : time_t time(time_t *t);
argument  : Timeを格納するvariableのaddress
return value : 基準Timeからのprogresssecond数
機能  : 現在のTimeを基準Timeからのprogresssecond数で返す。
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
機能  : プログラムが使用したプロセス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  : 基準Timeからのprogresssecond数1、基準Timeからのprogresssecond数2
return value : 2つのprogresssecond数の差
機能  : Timeの引き算をするDepending on the context, units other than seconds may be used.


localtime
function型 : struct tm *localtime(const time_t *t);
argument  : 基準Timeからのprogresssecond数
return value : second数を国内Time情報に変換したstruct
機能  : 基準Timeからのprogresssecond数を国内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  : 基準Timeからのprogresssecond数
return value : second数を国際Time情報に変換したstruct
機能  : 基準Timeからのprogresssecond数を国際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を変換した文字列の先頭address
機能  : Timeを Wed Feb 17 20:14:04 1988 のような文字列に変換する。
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  : 基準Timeからのprogresssecond数
return value : Timeを変換した文字列の先頭address
機能  : Timeを Wed Feb 17 20:14:04 1988 のような文字列に変換する。
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  : 文字array、文字arrayのサイズ、Time書式指定文字列、Timeを格納したstruct
Return value: The number of characters written to the array.0 if it fails.
機能  : Timeを指定された書式通りに文字列に変換する。


control
A set of functions primarily responsible for program control.
These each have different header files.

<assert.h> を必要とするfunction群


assert
function型 : void assert(int expression);
argument  : 診断するvariable値
return value : None
機能  : デバッグのために診断を行う。
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  : 送信するシグナル値
Return value: 0 on success, non-zero on failure.
機能  : プログラムにシグナルを送信する。



signal
function型 : void (*signal(int sig, void (*handler)()))();
argument  : 設定するシグナル値、シグナルを処理するfunctionのaddress
Return value: The address of the previously set function, or SIG_ERR on failure.
機能  : シグナルを処理するfunctionを設定する。


<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.
機能  : longjmpfunctionに備えて状態をSaveする。
Warning: This is a malicious function that will 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間をまたぐ広域ジャンプを行う
Warning: This is a malicious function that will 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) is
This 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.

Part 0: Program Overview
  1. What is a program?
Chapter 3: Displaying on the Screen
  1. String Display
  2. line break
  3. Practice Problem 3
Chapter 4: Displaying and Calculating Numbers
  1. Display of numbers
  2. Basic calculations
  3. Numeric types
  4. Practice Problem 4
Chapter 6: Input from the Keyboard
  1. input function
  2. The fear of input
  3. Practice Problem 6
Chapter 9: Repeating a Fixed Number of Times
  1. Iterative sentence
  2. How Loops Work
  3. Practice Problem 9
Chapter 10: Repeating Without Knowing the Number of Times
  1. Unspecified loop
  2. Input validation
  3. Practice Problem 10
Chapter 13: Handling Multiple Variables at Once
  1. Handling multiple variables collectively.
  2. Arrays
  3. Practice Problem 13
Chapter 19: Dynamic Arrays
  1. Create arrays freely.
  2. Practice Problem 19