How can I write a two-dimensional array of binary data in Pascal?

Closed due to the fact that the question is too common for participants Streletz , cheops , user194374, aleksandr barakin , pavel Aug 18 '16 at 7:22 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • The answer is whatever you like. Try to write more detailed questions. To get an answer, explain exactly what you see the problem, how to reproduce it, what you want to get as a result, etc. Give a sample code. - Kromster
  • Does this answer suit you? Let's still clarify the question and find the best solution? ) - Kromster
  • It would be nice) I created an array of bin in pascal: array [1..2] of byte = ((0001), (0110)); The program recognizes its elements as 1 and 110, but I would like it to see exactly binary values. And I also have a question on two-dimensional arrays, maybe to create a chat? - JohnS

1 answer 1

Binary data can be stored in different forms.

For example, in the form of an array of Boolean elements (1 element = 1 bit).

arr: array of array of Bool; 

You can store as ordinary Integer and access them by masks to select specific bits (1 Integer = 32 bits).

 arr: array of array of Integer; 

And even as a string of text (1 character = 1 bit).

 arr: array of array of String;