名前空間
変種
操作

perror

提供: cppreference.com
< c‎ | io

 
 
File input/output
機能します
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファイルアクセス
Original:
File access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
直接入力/出力
Original:
Direct input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
fread
fwrite
書式なし入力/出力
Original:
Unformatted input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
書式付き入力/出力
Original:
Formatted input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファイル位置付け
Original:
File positioning
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ftell
fgetpos
fseek
fsetpos
rewind
エラー処理
Original:
Error handling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
clearerr
feof
ferror
perror
ファイルに対する操作
Original:
Operations on files
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
remove
rename
tmpfile
tmpnam
 
Defined in header <stdio.h>
void perror( const char *s );
NULLで終わる文字列が現在のシステム変数に格納されているエラーコードを説明する実装定義のエラーメッセージが続く2文字stderr、続いて、(sがNULLポインターである場合を除きます)sが指すの": "内容へのプリントerrnostrerror(errno)の出力と同じ)、'\n'続く.
Original:
Prints to stderr the contents of the null-terminated character string pointed to by s (unless s is a null pointer), followed by the two characters ": ", followed by the implementation-defined error message describing the error code currently stored in the system variable errno (identical to the output of strerror(errno)), followed by '\n'.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

s -
説明メッセージがNULLで終わる文字列へのポインタ
Original:
pointer to a null-terminated string with explanatory message
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <fcntl.h>
#include <stdio.h>
 
int main()
{
    if (open("non_existent", O_RDONLY) == -1) {
        perror("open()");
    }
}

Output:

open(): No such file or directory

[編集] も参照してください

指定したエラーコードのテキストバージョンを返します
Original:
returns a text version of a given error code
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数) [edit]