读取一个在C ++中以0开头的整数 [英] Read an integer that start with 0 in C++

查看:133
本文介绍了读取一个在C ++中以0开头的整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!我是c +的新手,我不知道如何读取以0开头的数字。

例如,如果我有0765并且我想读这个数字我会有765,但是我想要0765.提前致谢!

Hi! I'm new in c++ and i don't know how to read a number that start with 0.
For example if i have 0765 and i want to read this number i will have 765 , but i want 0765. Thanks in advance!

推荐答案

这听起来没有意义,如果你读了这四个字,那就是你将拥有的。但是,如果您正在谈论将其转换为八进制数0765,那么您应该查看 http:// msdn.microsoft.com/en-us/library/w4z2wdyc.aspx [ ^ ]。
That does not really make sense, if you read those four characters then that is what you will have. However, if you are talking about converting it to the octal number 0765, then you should look at http://msdn.microsoft.com/en-us/library/w4z2wdyc.aspx[^].


这篇关于读取一个在C ++中以0开头的整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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