That I already knew. Translating that pseudo-code into actual C or C++ or Java code is hardly the easiest way to do this. Someone recommended googling 'Hex Editor' which I will be doing now.
Since your original posting sounded (and still does) like "Please do my homework for me" I didn't want to spill too much. So please tell me: are you learning C/C++/Java? By yourself or in class? Is this a homework assignment? What have you got so far? Are you stuck on any specific part?
I'll be happy to help someone learn as long as I'm sure I'm not helping cheat.
I graduated from college years ago. I have since been writing a lot of PHP and have rarely, if ever, dealt with raw binary files. I can totally appreciate your desire to not assist those little cheats. I am not one of them. I am, however, returning to C++ after many years absence.
If you only want to display a raw file, hexdump is perfect for that. From your original post, however, it seemed that you only want to display those postition matching a certain pattern of that file.
Should you want to implement something similar yourself, file opening and loops work pretty much the same as in PHP, "strings" are really arrays of char (which is 1 byte), and printf has a %X conversion, which will output the value as hex. If you need more information, feel free to ask.
I think we got confused since you were asking in the programming forum. You just wanted an existing tool, people thought you wanted us to make you one.
Aha. In retrospect I should perhaps have put this post in 'linux for dummies' forum or perhaps in 'unix and linux applications'. My original thinking was that there *must* be some tool in XCode or typically existing in an IDE for inspecting the bits/hex of a binary file. I have installed Eclipse also but the library I must work with apparently requires the CoreServices library which is so easy to link up in XCode. So far I'm still just getting used to the elaborate IDE stuff. I code PHP in a glorified text editor.
Pludi, that %X tip is a good one for me at this point. I was using %d on floats and %s on integers and getting some pretty weird behavior. Darn strongly typed languages! I'm hoping to learn (re-learn?) all the tips for finding the right library for my task at hand but also at finding the documentation for a given library or command.
Cheers! Thanks for the help. I'll probably be around asking lots more questions -- and hopefully answering a few as payback if I can get my footing.