std::strerror
提供: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 <cstring>
|
||
| char* strerror( int errnum ); |
||
戻り値のエラーコードのテキストバージョン
errnum。errnum通常errno変数から取得された、しかし、この関数は、型intの任意の値を受け入れます。メッセージはロケール固有.Original:
Returns text version of the error code
errnum. errnum is usually acquired from the errno variable, however the function accepts any value of type int. The message is locale-specific.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.
返されたバイト文字列が変更されてはならないさプログラムによって、しかし
strerror関数への後続の呼び出しによって上書きされることがあり. Original:
The returned byte string must not be modified by the program, but may be overwritten by a subsequent call to the
strerror function. 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.
目次 |
[編集] パラメータ
| errnum | - | エラーコードを参照する整数値
Original: integral value referring to a error code The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] 値を返します
エラーコードに対応するNULL終端バイト文字列へのポインタ
errnum.Original:
Pointer to a null-terminated byte string corresponding to the error code
errnum.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 <iostream> #include <cmath> #include <cerrno> #include <cstring> int main() { double not_a_number = std::log(-1.0); if (errno == EDOM) { std::cout << "log(-1) failed: " << std::strerror(errno) << '\n'; } }
Output:
log(-1) failed: Numerical argument out of domain
[編集] も参照してください
| 標準のPOSIX互換のエラー条件のためのマクロ Original: macros for standard POSIX-compatible error conditions 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 strerror
| |