English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

as a+ i*Size of Data type for a[i];

2006-08-10 23:32:41 · 5 answers · asked by sandeep 1 in Computers & Internet Programming & Design

5 answers

Static array types are denoted by constructions of the form

array[indexType1, ..., indexTypen] of baseType

where each indexType is an ordinal type whose range does not exceed 2GB. Since the indexTypes index the array, the number of elements an array can hold is limited by the product of the sizes of the indexTypes. In practice, indexTypes are usually integer subranges.
In the simplest case of a one-dimensional array, there is only a single indexType. For example,

var MyArray: array[1..100] of Char;

declares a variable called MyArray that holds an array of 100 character values. Given this declaration, MyArray[3] denotes the third character in MyArray. If you create a static array but don’t assign values to all its elements, the unused elements are still allocated and contain random data; they are like uninitialized variables.
A multidimensional array is an array of arrays. For example,

type TMatrix = array[1..10] of array[1..50] of Real;

is equivalent to

type TMatrix = array[1..10, 1..50] of Real;

Whichever way TMatrix is declared, it represents an array of 500 real values. A variable MyMatrix of type TMatrix can be indexed like this: MyMatrix[2,45]; or like this: MyMatrix[2][45]. Similarly,

packed array[Boolean,1..10,TShoeSize] of Integer;

is equivalent to

packed array[Boolean] of packed array[1..10] of packed array[TShoeSize] of Integer;

The standard functions Low and High operate on array type identifiers and variables. They return the low and high bounds of the array’s first index type. The standard function Length returns the number of elements in the array’s first dimension.
A one-dimensional, packed, static array of Char values is called a packed string. Packed-string types are compatible with string types and with other packed-string types that have the same number of elements. See Type compatibility and identity.

An array type of the form array[0..x] of Char is called a zero-based character array. Zero-based character arrays are used to store null-terminated strings and are compatible with PChar values. See Working with null-terminated strings.

2006-08-10 23:50:50 · answer #1 · answered by Anonymous · 0 0

u r question is somewhat difficult yet as far as i understood a million)to show array in 2-d format first of all create an array think of i rows and j coloumns then use 2 for gettin the values and for printing the values 2) for displayin an element like area of third row second purely print the fee at a[3][2] the position a is u r array 3) for exhibiting a row fix the i and run with incrementin j and print all values 4)for displayin particular column fix j and increment i an d print all values

2016-11-29 21:51:18 · answer #2 · answered by ? 3 · 0 0

Sandeep Hello again here is your link

http://www.planatechsolutions.com/xllplus-online/CXlOper_methods.htm
http://www.ibiblio.org/pub/languages/fortran/append-c.html

passing array

http://www.ibiblio.org/pub/languages/fortran/ch2-4.html

Two-Dimensional Arrays

http://www.mathsci.appstate.edu/~crr/cs2440/oldexamples/twodarrays.html

GOOD LUCK

2006-08-10 23:43:22 · answer #3 · answered by Joe_Young 6 · 0 0

same for 2D, the name is just a pointer no matter its 2D or linear. while traversing you shall get data row by row (C++)

2006-08-10 23:42:04 · answer #4 · answered by i.i 1 · 0 0

mention the language in which u are asking

2006-08-10 23:42:24 · answer #5 · answered by ~sandhya~ 2 · 0 1

fedest.com, questions and answers