<cctype> (ctype.h)


Character handling functions
This header declares a set of functions to classify and transform individual characters.
详见:http://www.cplusplus.com/reference/cctype/

此头文件包含14个函数,不需要什么详细解释,函数名代表了一切。
【所有函数的返回值均为int,参数列表均为一个int,如 int tolower ( int c );

  1. isalnum  // isalpha||isdigit
  2. isalpha
  3. isblank
  4. iscntrl
  5. isdigit //Check if character is decimal digit
  6. isgraph //Check if character has graphical representation
  7. islower
  8. isprint //Check if character is printable
  9. ispunct
  10. isspace
  11. isupper
  12. isxdigit //Check if character is hexadecimal digit
  13. tolower
  14. toupper

实际上,这些函数手打也是很方便的,但是不如这样优雅……

CC BY-NC-SA 4.0 cctype by J. Chen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.