在磁盘上写入原始数据。 [英] Writing raw data on disk.
本文介绍了在磁盘上写入原始数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好。
我最近搞乱了虚拟文件系统,但是我遇到了问题。
我想保存一个结构虚拟磁盘作为原始数据。我怎样才能做到这一点?我应该转换每个会员吗?在struct的内部为char?
喜欢:" encrypt"和decript好东西?
注意:我正在将char []缓冲区写入磁盘!
谢谢!
Hi guys.
I am messing around with virtual file systems lately, but i have a problem.
I want to save a structure on the virtual disk as raw data. How can i do this? Should i convert each "member" inside the struct to char?
like: "encrypt" and "decript" thingy?
Note: I''m writing char[] buffer to the disk!
Thanks!
推荐答案
是的,文件流是一个char文件流。您可能还需要字段分隔符,您可以重新读取数据。
Yes, the file stream is a char file stream. You may also want field delimiters to you can read the data back in.
展开 | 选择 | Wrap < span class =codeDivider> | 行号
是的,文件流是一个char文件流。您可能还需要字段分隔符,您可以重新读取数据。
Yes, the file stream is a char file stream. You may also want field delimiters to you can read the data back in.
展开 | 选择 | Wrap < span class =codeDivider> | 行号
如果他将使用>>提取数据,我认为空格可以作为分隔符。
If he will be using >> to extract data,I think that whitespace can serve as a delimiter.
这是一个if。
如果数据不包含空格,那就是另一个。
但是,根据这两个问题的答案,那么你可能是正确的。
That''s an if.
And it''s another if that the data does not contain whitespace.
However, depending upon the answers to those two if''s, then you may be correct.
这篇关于在磁盘上写入原始数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文