A89: Re: Help with C
[Prev][Next][Index][Thread]
A89: Re: Help with C
First of all, a matrix in C is very different from a matrix in the TI-OS. In
C all the items in the matrix must be the same type. The indicies are not
seperated by commas, but are each in their own subscript brackets. So I
declare a matrix of integers like this:
int matrix[100][100];
or:
int matrix[10][10] = { {0,1,2,3,4,5,6,7,8,9}, {1,2,3,4,5,6,7,8,9,10},
{2,3,4,5,6,7,8,9,10,11}};
Actually, there are a number of ways to initialize a matrix.
-Kevin
-----Original Message-----
From: Brady Simon <bradys9@yahoo.com>
To: assembly-89@lists.ticalc.org <assembly-89@lists.ticalc.org>
Date: Wednesday, April 12, 2000 11:36 PM
Subject: A89: Help with C
>
>Can someone tell me why my code won't compile. I am new to matrix's in C.
>All I want to do is make a matrix so I can display a list of strings at
>different points.
>Can someone tell me how to do matrix's if I am doing them wrong.
>Thanks
>
>#include <nostub.h>
>#include <graph.h>
>#include <kbd.h>
>
>int _ti89,_ti92plus; // compile for both calcs
>
>int _main(void)
>{
> LCD_BUFFER buffer;
> int mmenu[7,3];
> LCD_save(buffer);
> ClrScr();
>
> mmenu[7,3] = {
> {"START",10,1},
> {"PLAYERS",10,6},
> {"ROUNDS",10,11},
> {"ECONOMICS",10,16},
> {"PHYSICS",10,21},
> {"LANDSCAPE",10,26},
> {"PLAYER OPTIONS",10,31},
> {"WEAPONS",10,36},
> {"SAVE CHANGES",10,41}
> };
> ngetchx();
> LCD_restore(buffer);
>}
>
>
>__________________________________________________
>Do You Yahoo!?
>Talk to your friends online with Yahoo! Messenger.
>http://im.yahoo.com
>