To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 4437
4436  |  4438
Subject: 
Re: Multi dimentional Arrays
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Tue, 29 Sep 1998 16:38:48 GMT
Original-From: 
Will <willbain@/spamcake/cs.umt.edu>
Reply-To: 
(willbain@cs.umt)StopSpam(.edu)
Viewed: 
1060 times
  
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:
  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:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR