zoukankan      html  css  js  c++  java
  • 无符号字符型 与 扩展ASCII码表

    In C++ we have seen there is character type data called char. Sometimes we have seen unsigned char also. So here we will see what is basically the unsigned char means. What are the basic differences between signed char and unsigned char?

    Signed char and unsigned char both are used to store single character. The variable stores the ASCII value of the characters. For an example if ‘A’ is stored, actually it will hold 65. For signed char we need not to write the signed keyword. But for unsigned, we have to mention the keyword. The syntax is like below.

    unsigned char ch = ‘n’;

    Both of the Signed and Unsigned char, they are of 8-bits. So for signed char it can store value from -128 to +127, and the unsigned char will store 0 to 255.

    The basic ASCII values are in range 0 to 127. The rest part of the ASCII is known as extended ASCII. Using char or signed char we cannot store the extended ASCII values. By using the unsigned char, we can store the extended part as its range is 0 to 255.

    By Smita Kapse

    https://www.tutorialspoint.com/what-is-an-unsigned-char-in-cplusplus

  • 相关阅读:
    生活感悟
    shell语法
    mycat
    阐述 如何高效理解学习
    部署ETCD集群
    文件修改
    文件处理
    a's
    shell中备份web站点及数据库
    openssh版本升级修复漏洞
  • 原文地址:https://www.cnblogs.com/liujx2019/p/14185505.html
Copyright © 2011-2022 走看看