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

int prepex [3][4] = { {1,2,3},{4,5,6},{7,8,9},{0,-1,-2} };

2007-01-26 08:27:02 · 2 answers · asked by Mike T 2 in Computers & Internet Programming & Design

2 answers

well aside from .... -1 can't be a number in an array.

Also, you had this written backwards, you had the assignment statement written with 3 rows and 4 columns, but you were assigning one value to short in every row, and you had one extra column...anyway, here is an example of what I mean

int array[3][4]= {{1,2,3,0},{4,5,6,4},{7,8,9,5}};

2007-01-26 09:08:11 · answer #1 · answered by D 4 · 0 1

If it is [3][4], try: int prepex[3][4] = {{1,2,3,4},{5,6,7,8},{9,10,11,12};
prepex can be accessed as follows: prepex[0], prepex[1], prepex[2] for first, second, and third data sets. Index numbers are one numerical value less than actual position. First index value is zero instead of one.

2007-01-26 16:53:44 · answer #2 · answered by Researcher of Knowledge 1 · 1 0

fedest.com, questions and answers