不反转十六进制转换? [英] Unreversing hexadecimal conversion?

查看:65
本文介绍了不反转十六进制转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我从十进制转换为十六进制,我只能反复十六进制的相反顺序?!我怎么能扭转这个顺序呢?继承我的代码:

展开 | 选择 | Wrap | 行号

解决方案

而不是输出到cout输出到字符串流,然后当你完成反转字符串并输出字符串。


实际上更好的还没有输出到你的功能cout,你有功能创建和返回一个字符串并从你的main函数输出字符串。


我不知道为什么这个线程被关闭了;另一种解决方案就是简单地反转这样的递归步骤:

展开 | 选择 | 换行 | 行号


< blockquote>


我不知道为什么这个帖子被关闭了;



抱歉这是我,今天早上咖啡还不够,谢谢你重新打开它。


Ok so I am converting to hexadecimal from decimal and I can only cout the reverse order of the hexadecimal?! How could I reverse this so its the right order? Heres my code:

Expand|Select|Wrap|Line Numbers

解决方案

Instead of outputting to cout output to a string stream, then when you have finished reverse the string and output the string.

In fact better still don''t output to cout in you function at all, have you function create and return a string and output the string from you main function.


I don''t know why this thread was closed; another solution would be to simply
reverse the recursive steps like this:

Expand|Select|Wrap|Line Numbers


I don''t know why this thread was closed;

Sorry that was me, not enough coffee yet this morning, thank you for re-opening it.


这篇关于不反转十六进制转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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