Prism 6.0 User's Guide

Using Array-Section Syntax in C arrays

You can use Fortran 90 array-section syntax when specifying C arrays. This syntax is useful, for example, if you want to print the values of only a subset of the elements of an array. The syntax is:

(lower-bound: upper-bound: stride)

where

You must enclose the values in parentheses (rather than brackets), as in Fortran. If your array is multidimensional, you must separate the dimension specifications with commas within the parentheses, once again as in Fortran.

For example, if you have this array:

int a[10][20];

then you can issue this command in Prism to print the values of elements 2-4 of the first dimension and 2-10 of the second dimension:

(prism) print a(2:4,2:10)