Solved

reading and analyzing binary data from a file

Posted on 1998-10-23
3
180 Views
Last Modified: 2010-04-15
I am trying to read a binary file and do some analysis of the information contained.  I am using fread(name,4,1,fp) where name is a char[4], name is supposed to receive whatever I read in, but I can't make sense of what is read in.  Can someone help me read this information in and analyze it?
Thanks
0
Comment
Question by:curtisn
3 Comments
 
LVL 84

Expert Comment

by:ozo
Comment Utility
what's in the file?  what's the format of the file?  what did you find in name?
0
 

Accepted Solution

by:
dynasoft earned 100 total points
Comment Utility
A. Start by creating a simple test file that contains something like "ABCD" and use that file to test your code.

B. Use your debugger if you can to inspect the name[] string after the fread().  If you can't use your debugger, please specify what compiler and operating system you are using and I will try to help further.

C. If the above test doesn't work, give me a sample of the code starting with the fopen().  By the way are you opening the file in binary mode?

D. If the test does work, let me know what you are trying to analyze or accomplish if you need further assistance.

If you would prefer private tutoring, please email me at dynasoft@juno.com

0
 

Author Comment

by:curtisn
Comment Utility
I was able to figure the problem and it wasn't a coding error.  I was using Visual C++ 6.0 and for some reason, the debugger couldn't show what was in the variables, I could see it in memory but it wasn't shown by the memory.

I changed to UNIX and was able to see the contents of the variables clearly,

thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now