将uint32 从little endian转换为char数组(写入文件)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将uint32 从little endian转换为char数组(写入文件)相关的知识,希望对你有一定的参考价值。

Do you know how to convert uint32_t in little endian to file like char array? I have a variable sumGlobalContentSum (in hex). Than i write in file dstFile. Value of sumGlobalContentSum is realy d1 when I write it out like cout
  1. uint32_t sumGlobalContentSum = ;
  2.  
  3. sumGlobalContentSum = 4+2+4+audioDataContentSumNonUsed+4 //=d1 [uint32_t audioDataContentSumNonUsed]
  4.  
  5. dstFile << hex << sumGlobalContentSum;

以上是关于将uint32 从little endian转换为char数组(写入文件)的主要内容,如果未能解决你的问题,请参考以下文章

将little-endian转换为ASCII

如何将字节从 uint64_t 转换为 double?

c_cpp Ledger SDK解包Big / Little-Endian 8字节Uint64

将带有 CRLF 行终止符的 Little-endian UTF-16 Unicode 英文文本文件转换为 Ascii 编码

转换缓冲区表示 int little endian Python 类的列表

如何正确地将 USC-2 little endian 转换为 UTF-8?