名前空間
変種
操作

std::strerror

提供: cppreference.com
< cpp‎ | string‎ | byte

 
 
ストリングスライブラリ
NULLで終わる文字列
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
バイト文字列
文字列をマルチバイト
ワイド文字列
クラス
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
NULL終端バイト文字列
機能します
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:
Character manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
数値形式への変換
Original:
Conversions to numeric formats
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
文字列操作
Original:
String manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
strcpy
strncpy
strcat
strncat
strxfrm
文字列の検査
Original:
String examination
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
メモリ操作
Original:
Memory manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
memchr
memcmp
memset
memcpy
memmove
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
strerror
 
Defined in header <cstring>
char* strerror( int errnum );
戻り値のエラーコードのテキストバージョンerrnumerrnum通常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.
返されたバイト文字列が変更されてはならないさプログラムによって、しかし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.

目次

[編集] パラメータ

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.

[編集]

[edit]
#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.

(マクロ定数) [edit]
C documentation for strerror