1. 程式人生 > >C++ 標準庫之cctype

C++ 標準庫之cctype

               

C++ 語言下標頭檔案:#include <cctype>說明: 字元處理庫功能一:字元測試1> 函式原型均為int isxxxx(int)2> 引數為int, 任何實參均被提升成整型3> 只能正確處理處於[0, 127]之間的值功能二:字元對映1> 函式原型為int toxxxx(int)2> 對引數進行檢測, 若符合範圍則轉換, 否則不變

備註說明:C語言下的此類功能標頭檔案是<ctype.h>以下是<cctype>標頭檔案的宣告:

[cpp] view plain copy print?
  1. // cctype standard header
  2. #pragma once
  3. #ifndef _CCTYPE_
  4. #define _CCTYPE_
  5. #include <yvals.h>
  6. #ifdef _STD_USING
  7.  #undef _STD_USING
  8.   #include <ctype.h>
  9.  #define _STD_USING
  10. #else /* _STD_USING */
  11.  #include <ctype.h>
  12. #endif /* _STD_USING */
  13. #ifndef RC_INVOKED
  14.  #if _GLOBAL_USING
  15. _STD_BEGIN  
  16. using ::isalnum; using ::isalpha; using
     ::iscntrl;  
  17. using ::isdigit; using ::isgraph; using ::islower;  
  18. using ::isprint; using ::ispunct; using ::isspace;  
  19. using ::isupper; using ::isxdigit; using ::tolower;  
  20. using ::toupper;  
  21. _STD_END  
  22.  #endif /* _GLOBAL_USING */
  23. #endif /* RC_INVOKED */
  24.     /* remove any (improper) macro overrides */
  25. #undef isalnum
  26. #undef isalpha
  27. #undef isblank
  28. #undef iscntrl
  29. #undef isdigit
  30. #undef isgraph
  31. #undef islower
  32. #undef isprint
  33. #undef ispunct
  34. #undef isspace
  35. #undef isupper
  36. #undef isxdigit
  37. #undef tolower
  38. #undef toupper
  39. #endif /* _CCTYPE_ */
  40. /* 
  41.  * Copyright (c) 1992-2006 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  42.  * Consult your license regarding permissions and restrictions. 
  43.  V5.02:0009 */
// cctype standard header#pragma once#ifndef _CCTYPE_#define _CCTYPE_#include <yvals.h>#ifdef _STD_USING #undef _STD_USING  #include <ctype.h> #define _STD_USING#else /* _STD_USING */ #include <ctype.h>#endif /* _STD_USING */#ifndef RC_INVOKED #if _GLOBAL_USING_STD_BEGINusing ::isalnum; using ::isalpha; using ::iscntrl;using ::isdigit; using ::isgraph; using ::islower;using ::isprint; using ::ispunct; using ::isspace;using ::isupper; using ::isxdigit; using ::tolower;using ::toupper;_STD_END #endif /* _GLOBAL_USING */#endif /* RC_INVOKED */ /* remove any (improper) macro overrides */#undef isalnum#undef isalpha#undef isblank#undef iscntrl#undef isdigit#undef isgraph#undef islower#undef isprint#undef ispunct#undef isspace#undef isupper#undef isxdigit#undef tolower#undef toupper#endif /* _CCTYPE_ *//* * Copyright (c) 1992-2006 by P.J. Plauger.  ALL RIGHTS RESERVED. * Consult your license regarding permissions and restrictions. V5.02:0009 */