Topic: user defined data types


Author: andersc@tch13.cs.jmu.edu (chad andersen )
Date: Tue, 25 Jan 1994 04:47:53 GMT
Raw View
I have a problem.  I need to get some advice on how to define
a data type.  I need to read a binary file of 1,2,4, or 8 byte
integers.  These integers need to then be placed into a long int.

problems: I need to do this a fast as possible.  The file I'm working
with is gig's.  The time thing is the biggest factor.  I also neeed
to deal with negative numbers.  If I read a 1 byte int into a long
int, I need to deal with carring over the leading 1's if the number
is negative.  I'd like to be able to define a class or something
to deal with all the manipulation of the data.  But it needs to be
FAST!  I could write it in C, but I think I could get better results
if the code is in C++.

I learned C++ from a book.  I don't know all the ins and outs of
the language.  I'm looking for a quick way to handle this problem.
Thanks for your time and knowledge.

Chad Andersen
James Madison University CS Major