C++ MB_LEN_MAX 宏常量
MB_LEN_MAX 常量是在 climits 頭中定義的宏常量,用於獲取多字節字符中的最大字節數,對於任何語言環境,它返回多字節字符的最大字節數,即 1 或更多.
注意:
- 實際值取決於編譯器架構或庫實現。
- 我們也可以使用
<limits.h>
頭文件而不是<climits>
兩個庫中都定義了作為 MB_LEN_MAX 常量的標頭。
MB_LEN_MAX 常量的語法:
MB_LEN_MAX
例:
Constant call: cout << MB_LEN_MAX; Output: 16
用於演示帶有 climits 標頭的 MB_LEN_MAX 常量示例的 C++ 代碼
// C++ code to demonstrate example of
// MB_LEN_MAX constant with climits header
#include<iostream>
#include<climits>
using namespace std;
int main()
{
//prinitng the value of MB_LEN_MAX
cout<<"MB_LEN_MAX:"<<MB_LEN_MAX<<endl;
return 0;
}
輸出
MB_LEN_MAX:16
使用limits.h頭文件演示MB_LEN_MAX常量示例的C++代碼
// C++ code to demonstrate example of
// MB_LEN_MAX constant with <limits.h> header file
#include<iostream>
#include<limits.h>
using namespace std;
int main()
{
//prinitng the value of MB_LEN_MAX
cout<<"MB_LEN_MAX:"<<MB_LEN_MAX<<endl;
return 0;
}
輸出
MB_LEN_MAX:16
相關用法
- C++ Math scalbn()用法及代碼示例
- C++ Math acosh()用法及代碼示例
- C++ Math asinh()用法及代碼示例
- C++ Math isgreater()用法及代碼示例
- C++ Math fabs()用法及代碼示例
- C++ Math islessgreater()用法及代碼示例
- C++ Math log2()用法及代碼示例
- C++ Math nearbyint()用法及代碼示例
- C++ Math tan()用法及代碼示例
- C++ Math log()用法及代碼示例
- C++ Math nextafter()用法及代碼示例
- C++ Math fdim()用法及代碼示例
- C++ Math isfinite()用法及代碼示例
- C++ Math erfc()用法及代碼示例
- C++ Math sinh()用法及代碼示例
- C++ Math scalbln()用法及代碼示例
- C++ Math cosh()用法及代碼示例
- C++ Math fma()用法及代碼示例
- C++ Math pow()用法及代碼示例
- C++ Multiset lower_bound()用法及代碼示例
注:本文由純淨天空篩選整理自 MB_LEN_MAX constant with example in C++。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。