Subject:
|
Re: Multi dimentional Arrays
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Tue, 29 Sep 1998 16:38:48 GMT
|
Original-From:
|
Will <willbain@=AvoidSpam=cs.umt.edu>
|
Reply-To:
|
willbain@SAYNOTOSPAMcs.umt.edu
|
Viewed:
|
1578 times
|
| |
![Post a public reply to this message](/news/icon-reply.gif) | |
Javaid Iqbal wrote:
> Hi All,
> I am trying to write a code for fuzzy logic and using Matrix havig a size
> of 10X10, but it gives an error (stack overflow). When i reduce the size
> of matrix to 6X6 it works perfectly.
<snip>
You might try using a one-dimensional array of size 100, along with a
simple indexing function to simulate a two-dimensional array:
int myarray[ 100 ];
int index( int row, int col ) {
return 10 * row + col;
}
void main() {
int i = 0, j = 4;
myarray[ index( i, j ) ] = 30;
printf( "myarray( %d, %d ) = %d", i, j, myarray[ index( i, j ) ]
);
}
Perhaps the one-dimensional array would be more memory-efficient. Good
luck!
--Will
, ,
__@_/ \_@__ |/
| /__, o @_/
)\ ) ( \ (\/\\,
~~~~~~~~~ ' ` ~~~~~~~~~~~ ` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wendy Parson, Suburbia is where the developer bulldozes out
Will Bain, the trees, then names the streets after them.
& Tatoosh --Bill Vaughn
|
|
Message is in Reply To:
![](/news/x.gif) | | Multi dimentional Arrays
|
| Hi All, I am trying to write a code for fuzzy logic and using Matrix havig a size of 10X10, but it gives an error (stack overflow). When i reduce the size of matrix to 6X6 it works perfectly.I am using IC 3.0. Can I use a matrix having a size (...) (26 years ago, 29-Sep-98, to lugnet.robotics.handyboard)
|
3 Messages in This Thread: ![Multi dimentional Arrays -handyboard@media.mit.edu (Javaid Iqbal) (29-Sep-98 to lugnet.robotics.handyboard)](/news/x.gif) ![](/news/246.gif) ![You are here](/news/here.gif)
![](/news/x.gif) ![](/news/68.gif) ![Re: Multi dimentional Arrays -handyboard@media.mit.edu (Rick Moll) (29-Sep-98 to lugnet.robotics.handyboard)](/news/x.gif)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|