Link to home
Start Free TrialLog in
Avatar of sneeuw
sneeuwFlag for Belgium

asked on

8 bytes data type

Hi,

I need to be able to keep track of files of over 2 GB so I need more than 4 bytes variables to store the byte length in.

I also need to be able to add or substract e.g. Len = Len1 + Len2 ;

The variable (may / has to be) unsigned.

I tried double (is double the only 8 bytes variable ??) but this one is of the type float ...

operators such as % don't work.
The byte mapping in the variable is also not what I expected.
E.g. I tried to memcpy the HiWord and LoWord out of doubles but this doesn't work.
When I looked at how the data is stored in the 8 bytes I couldn't make sense out of it (not what you e.g. can see in a DWORD)

Advice appreciated !
Sorry 40 points is all I have left
Avatar of mnashadka
mnashadka

What compiler are you using?  Many operating systems and compilers support an "unsigned long long" datatype, which is what you need.  I know that the GNU compiler supports this, as does the Compaq Tru64 compiler, but I don't believe that VC++ does (I may be mistaken).
Avatar of sneeuw

ASKER

Found it !

No unsigned long long doesn't work here (first thing I tried ;-)

__int64 does the job.

Thanks,
sneeuw,

These questions are still open and our records show you logged in recently. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days. Please note that the recommended minimum for an "Easy" question is 50 points.
https://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=20183446
https://www.experts-exchange.com/jsp/qShow.jsp?ta=winprog&qid=20158806
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20192985
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20151309
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20137274
https://www.experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20136466
https://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=20088277
https://www.experts-exchange.com/jsp/qShow.jsp?ta=javascript&qid=20183228

EXPERTS: Please leave your thoughts on this question here.

Thanks,

Netminder
Community Support Moderator
Experts Exchange
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial