M
M
Mors Clamor2020-10-24 04:15:11
Pascal
Mors Clamor, 2020-10-24 04:15:11

Converting byte array to number?

Hello! I have the Pascal language - a prerequisite and task is to read the file. There are 4 specific bytes in the file. I wrote them into an array of bytes. How can I cast these 4 bytes to a numeric variable (of type longint, I guess)? Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2020-10-24
@66demon666

By simple mathematical calculations:
a + b * 256 + c * 65536 + d * 16777216
In general, a bitwise shift is used for these purposes: shlandshr

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question