C++ cstring strerror() 函式
示例
輸出各種錯誤訊息
cout << strerror(0) << "\n";
cout << strerror(1) << "\n";
cout << strerror(2) << "\n";
cout << strerror(3) << "\n";
自己動手試一試 »
定義和用法
strerror()
函式返回一個 C 風格的字串,描述了錯誤程式碼的含義。
strerror()
函式定義在 <cstring>
標頭檔案中。
語法
strerror(int errcode);
引數值
引數 | 描述 |
---|---|
errcode | 必需。一個錯誤程式碼。 |
技術詳情
返回 | 一個指向 C 風格字串的指標,描述了錯誤程式碼的含義。 |
---|