如何向用户询问0到255之间的三个整数,因为无符号字符的范围可以是0到622537 [英] How to ask the user to inter three integers from 0 to 255, since unsigned character can range from 0 to 622537

查看:188
本文介绍了如何向用户询问0到255之间的三个整数,因为无符号字符的范围可以是0到622537的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在c中编程输入0到255之间的整数,因为无符号字符的范围是0到622537



我尝试过:



如何在c中编程输入0到255之间的整数,因为无符号字符的范围是0到622537

how can we program in c to enter integer from 0 to 255 , since unsigned character can range from 0 to 622537

What I have tried:

how can we program in c to enter integer from 0 to 255 , since unsigned character can range from 0 to 622537

推荐答案

如果存储大小为1byte,则无符号字符范围为0-255。您的问题有点不清楚。
Unsigned char range is 0-255 , if it is 1byte of storage size. Your questions is bit unclear.


首先,16位无符号字符的范围是0到65535.

使用户输入范围为0的整数255与char的范围无关。

问题表明你对C编程知之甚少。



学习C是一个漫长的过程,不要跳过步骤,暂时忘记你的项目,并真正学习C语言。

通过制作自己的项目来学习C就像通过赢得一级方程式锦标赛来学习开车一样,它不起作用。



这是该语言作者的C参考书的链接。

C编程语言 - 维基百科,免费的百科全书 [ ^ ]

https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf [ ^ ]

http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf [ ^ ]
First of all the range of a 16bits unsigned char is 0 to 65535.
Making the user enter an integer of range 0 to 255 is not related to the range of a char.
The question show that you have little understanding of C programming.

Learning C is a long process, don't skip steps, forget your project for now, and learn C really.
Learning C by making your own project is like learning to drive a car by winning the Formula 1 championship, it don't work.

Here is a link to C reference book by the authors of the language.
The C Programming Language - Wikipedia, the free encyclopedia[^]
https://hassanolity.files.wordpress.com/2013/11/the_c_programming_language_2.pdf[^]
http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf[^]


这篇关于如何向用户询问0到255之间的三个整数,因为无符号字符的范围可以是0到622537的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆