基于十六进制数据inc ++创建二进制文件 [英] Create a binary file based on hex data inc++

查看:99
本文介绍了基于十六进制数据inc ++创建二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于十六进制数据创建二进制文件54313032202020303030。

create a binary file based on hex data "54313032202020303030".

推荐答案

这有作业的气味,所以没有代码!

但是它真的很容易......



1创建一个足以容纳输出字节的缓冲区:输入/ 2的长度应该这样做。

2将一对十六进制数字转换为无符号字节,并将该字节添加到缓冲区。重复直到所有对用完为止。

3将缓冲区写入二进制模式的文件。
This smells of homework, so no code!
But it''s really easy...

1 Create a buffer big enough to hold the output bytes: length of input / 2 should do it.
2 Convert a pair of hex digits to a unsigned byte, and add the byte to a buffer. Repeat until all pairs are used up.
3 Write the buffer to a file in binary mode.


这篇关于基于十六进制数据inc ++创建二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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