C++ 标准库之cctype

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

C++ 语言下
头文件:#include <cctype>
说明: 字符处理库
功能一:字符测试
1> 函数原型均为int isxxxx(int)
2> 参数为int, 任何实参均被提升成整型
3> 只能正确处理处于[0, 127]之间的值

功能二:字符映射
1> 函数原型为int toxxxx(int)
2> 对参数进行检测, 若符合范围则转换, 否则不变

备注说明:C语言下的此类功能头文件是<ctype.h>
以下是<cctype>头文件的声明:

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

           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

这里写图片描述

猜你喜欢

转载自blog.csdn.net/jhfyuf/article/details/84058981