Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
C: Read signed 16 bit binary file
Name: Selma Date: November 24, 2003 at 12:22:09 Pacific OS: Window 2000 CPU/Ram: 256
Comment:
Hi,
How to read signed 16-bit binary file? I opened the file with, pFile = fopen ("TestRawData","rb"); and I have fread(&number_bin, 2,1,pFile); to read the data, but it's not reading the correct value. Does fread only return unsigned values? If so, what command should I use in order to read signed 16-bit?
Thanks! This simple thing has driven me crazy for the passed full day. Please help!
Name: myxp Date: November 24, 2003 at 16:05:15 Pacific
Reply:
Selma:
Try to use:
short int number_bin;
If you're still in trouble, let me know - OK?
"fread" returns the number of items read from the "pFile" stream. If "pFile" points to 10 items, and you decide to read say 4 of these items then the return value is 4.
Summary: Hi all, I am trying to read time from a binary file, but I couldn't get the right value. Each record is 112 bytes in binary file. time format is YYYYDDDHHMMSSTHT YYYY = Year DDD = Day of the year HH =...
Summary: Can Somebody help me in this. How to make a c program so that if i give a filename to it as a command line argument, it tells the type of file it is? e.g if i give it a core file, it says that it is a...
Summary: hi im using this function to read the current position of a mechanical arm.I was told this is the way to convert array elements to binary number.Is this procedure correct? it seems that when the movem...