在C和C#中的介绍 [英] coversion in C and C#
本文介绍了在C和C#中的介绍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请告诉我如何使用C或C#将二进制值转换为十进制值
输入将来自用户并转换为二进制
please tell me how to convert decimal value in binary by using C or C#
input will take from the user and convrt into binary
推荐答案
此 ^ ]显示了如何在C#中完成.
阅读提到的教程 [
This article[^] shows how it is done in C#.
Reading the mentioned tutorial[^] might be useful for understanding the binary system.
您可能会惊讶:没有这样的东西作为十进制数".所有数字都是二进制",或者更好的是以10或8或16为底的概念或任何其他数字均不适用于数字.此概念仅适用于数字的人类可读字符串表示形式.您只能将包含数字的小数表示形式的字符串转换为包含数字的二进制表示形式的字符串.两个对象都不是数字.
—SA
You might be surprised: there is not such thing as "decimal number". All numbers a "binary", or, to say better, the notion of base 10 or 8 or 16 or any other is not applicable to numbers. This notion is only applicable to string human-readable representation of numbers. You can only convert a string containing decimal representation of a number to string containing binary representation of a number. Both objects are not numbers.
—SA
这篇关于在C和C#中的介绍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文