How to read 'long long' from binary file?

조회 수: 2 (최근 30일)
Andrew
Andrew 2014년 3월 25일
답변: James Tursa 2014년 3월 25일
Hello community,
I've got a binary file which was written with C++. How can I read a number in 'long long' format (8 bytes)? In the Matlab help I found only this info:
reading binary file with function _ fread(fileID, sizeA, precision)_ where precision could be only 'long' (in my case), but this is only 4 bytes.
Thanks in advance!
Andrew

채택된 답변

James Tursa
James Tursa 2014년 3월 25일
For precision use '*int64'. If the file was written on a different machine you may need to deal with endian stuff as well.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by