日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

'unsigned char'-C编程中的声明,赋值和用法

發布時間:2023/12/1 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 'unsigned char'-C编程中的声明,赋值和用法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

char is a data type in C programming language which can store value from -128 to +127. It generally used to store character values.

char是C編程語言中的數據類型,可以存儲從-128到+127的值 。 它通常用于存儲字符值。

unsigned is a qualifier which is used to increase the values to be written in the memory blocks. For example - char can store values between -128 to +127, while an unsigned char can store value from 0 to 255 only.

unsigned是一個限定符,用于增加要寫入存儲塊的值。 例如-char可以存儲-128到+127之間的值, 而無符號char只能存儲0到255之間的值。

unsigned store only positive values, its range starts from 0 to (MAX_VALUE*2)+1.

unsigned僅存儲正值,其范圍從0到(MAX_VALUE * 2)+1 。

unsigned char is a character data type with larger range of the value than signed char.

unsigned char是字符數據類型,其值范圍比signed char大 。

Whenever we work with positive value between the range of 0 to 255, we can use unsigned char instead of short, int type of data type.

只要我們使用0到255之間的正值,就可以使用unsigned char代替數據類型的short , int類型。

Declaration syntax:

聲明語法:

unsigned char variable_name;

Declaration example:

聲明示例:

unsigned char age;

程序讀取并打印C中的未簽名char值 (Program to read and print the unsigned char value in C)

#include <stdio.h>int main() {unsigned char age;printf("Enter age: ");scanf("%d",&age);printf("Input age is: %d\n",age);return 0; }

Output

輸出量

Enter age: 75 Input age is: 75

翻譯自: https://www.includehelp.com/code-snippets/unsigned-char-declaration-read-and-print-in-c-language.aspx

總結

以上是生活随笔為你收集整理的'unsigned char'-C编程中的声明,赋值和用法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。