Project

General

Profile

Bug #4173 » test_ctype.cc

Alexander Pyhalov, 2013-10-04 02:52 PM

 
1
#include <iostream>       // std::cout, std::boolalpha
2
#include <locale>         // std::locale, std::ctype, std::use_facet
3

    
4
int main ()
5
{
6
  std::locale loc;
7
  const std::string s =std::string("?");
8

    
9
  setlocale(LC_ALL,"");
10
  std::cout << '"' << s << "\"\n";
11

    
12
  unsigned char letter = *s.begin();
13
  std::cout << "letter is " <<letter <<"\n";
14
  std::cout << std::boolalpha;
15
  std::cout << (bool)(__ctype_mask[letter]& _ISALPHA);
16
 /* std::use_facet< std::ctype<char> >(loc).is (std::ctype<char>::alpha, *s.begin()) ; */
17
  std::cout << '\n';
18

    
19
  return 0;
20
}
(2-2/2)