Posted By

Lukynn on 03/18/15


endian c++ Little

Versions (?)

Conversion uint32_t in little endian to char array (write in file)

 / Published in: C++

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 << hex ... But when I write it in file, it puts me in "64 31 00 00". I want to have d1 00 00 00. Do you know how to get that? Thanks!!

  1. uint32_t sumGlobalContentSum = ;
  3. sumGlobalContentSum = 4+2+4+audioDataContentSumNonUsed+4 //=d1 [uint32_t audioDataContentSumNonUsed]
  5. dstFile << hex << sumGlobalContentSum;

Report this snippet  

You need to login to post a comment.