若要檢視英文版的文章,請選取 [原文] 核取方塊。您也可以將滑鼠指標移到文字上,即可在快顯視窗顯示英文原文。
譯文
原文
建議使用 Visual Studio 2017

isupper

 

測試項目置於地區設定是否以大寫。


   template<Class CharType>
bool isupper(
   CharType _Ch, 
   const locale& _Loc
)

_Ch

項目要測試的。

_Loc

包含項目的地區設定要測試。

true ,如果測試的是一個大寫字元; false

樣板函式會傳回 use_facet<ctype<CharType> >(_Loc)。(ctype<CharType>::upper_Ch)。

範例

// locale_isupper.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>

using namespace std;

int main( )   
{
   locale loc ( "German_Germany" );
   bool result1 = isupper ( 'L', loc );
   bool result2 = isupper ( 'n', loc );
   bool result3 = isupper ( '3', loc );

   if ( result1 )
      cout << "The character 'L' in the locale is "
           << "a uppercase character." << endl;
   else
      cout << "The character 'L' in the locale is "
           << " not a uppercase character." << endl;

   if ( result2 )
      cout << "The character 'n' in the locale is "
           << "a uppercase character." << endl;
   else
      cout << "The character 'n' in the locale is "
           << " not a uppercase character." << endl;

   if ( result3 )
      cout << "The character '3' in the locale is "
           << "a uppercase character." << endl;
   else
      cout << "The character '3' in the locale is "
           << " not a uppercase character." << endl;
}

The character 'L' in the locale is a uppercase character.
The character 'n' in the locale is  not a uppercase character.
The character '3' in the locale is  not a uppercase character.

需求

標題: <地區設定>

命名空間: std

顯示: