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

  • 相关阅读:
    _1_html_框架
    _0_web_基础
    _0_工具
    虚拟机安装与使用
    NumPy数据类型
    NumPy Ndarray对象
    机器学习之K-近邻(KNN)算法
    vue项目如何打包扔向服务器
    Eslint 规则说明
    Python ssh 远程执行shell命令
  • 原文地址:https://www.cnblogs.com/liujx2019/p/14185505.html
Copyright © 2011-2022 走看看