perror
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <stdio.h>
|
||
| void perror( const char *s ); |
||
NULLで終わる文字列が現在のシステム変数に格納されているエラーコードを説明する実装定義のエラーメッセージが続く2文字stderr、続いて、(
sがNULLポインターである場合を除きます)sが指すの": "内容へのプリントerrno(strerror(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.
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.
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. (機能) | |
| C++ documentation for perror
| |