3D array in Pascal

Thread Starter

lkgan

Joined Dec 18, 2009
117
Hi everyone,

Currently I am using a 3D array variable in Pascal language. Can the types of declaration in each dimensional be different. For eg, a 3D variable was declared as

Value : array[0..2, 0..3, 0..5] of longint.

And now I use it as below:

Value [A, B, C] := number;

My question is, for eg, can A be declared as int, B declared as int, and C declared as longint? Since the Value array was declared as longint, A, B and C should also ONLY declared as longint? :confused:

Thanks in advance for answering my question. :)
 

avtanski

Joined May 29, 2008
12
Actually neither A, B, or C are longint. The longint is the value of the array and it has nothing to do with the types of A, B, and C. For A, B, and C even a shortint would do.

I hope I understand your question correctly.
 

Thread Starter

lkgan

Joined Dec 18, 2009
117
I don't quite know how to use a struct in C, can you please give me the example base on my example above?
 
Top