zoukankan      html  css  js  c++  java
  • 字符函数库 cctype

    <cctype> (ctype.h)

    Character handling functions
    This header declares a set of functions to classify and transform individual characters.

    Functions

    These functions take the int equivalent of one character as parameter and return an int that can either be another character or a value representing a boolean value: an int value of 0 means false, and an int value different from 0represents true.

    There are two sets of functions:

    Character classification functions

    They check whether the character passed as parameter belongs to a certain category:


    Character conversion functions

    Two functions that convert between letter cases:

    For the first set, here is a map of how the original 127-character ASCII set is considered by each function (an x indicates that the function returns true on that character)

    ASCII values characters iscntrl isblank isspace isupper islower isalpha isdigit isxdigit isalnum ispunct isgraph isprint
    0x00 .. 0x08 NUL, (other control codes) x                      
    0x09 tab (' ') x x x                  
    0x0A .. 0x0D (white-space control codes:'f','v',' ',' ') x   x                  
    0x0E .. 0x1F (other control codes) x                      
    0x20 space (' ')   x x                 x
    0x21 .. 0x2F !"#$%&'()*+,-./                   x x x
    0x30 .. 0x39 0123456789             x x x   x x
    0x3a .. 0x40 :;<=>?@                   x x x
    0x41 .. 0x46 ABCDEF       x   x   x x   x x
    0x47 .. 0x5A GHIJKLMNOPQRSTUVWXYZ       x   x     x   x x
    0x5B .. 0x60 []^_`                   x x x
    0x61 .. 0x66 abcdef         x x   x x   x x
    0x67 .. 0x7A ghijklmnopqrstuvwxyz         x x     x   x x
    0x7B .. 0x7E {|}~                   x x x
    0x7F (DEL) x                      

    The characters in the extended character set (above 0x7F) may belong to diverse categories depending on the locale and the platform. As a general rule, ispunctisgraph and isprint return true on these for the standard C locale on most platforms supporting extended character sets.
  • 相关阅读:
    设计模式_桥梁模式
    C++基础学习教程(一)
    Python图像处理(11):k均值
    Cygwin-安装和配置ssh服务
    LeetCode11:Container With Most Water
    事务四大特征:原子性,一致性,隔离性和持久性(ACID)
    2014微软编程之美初赛第一场第三题 活动中心
    改进xutils下载管理器,使其,在随意地方进行进度更新,以及其它状态监听操作
    IT痴汉的工作现状21-Android开发前景论
    Spring配置文件总结
  • 原文地址:https://www.cnblogs.com/zjzyh/p/4074580.html
Copyright © 2011-2022 走看看