473,326 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Help in array of array of classes needed

I want to create class Matrix which contains array of class Rows.
Class Rows contains array of Cells.

Here is the declaration:

public class Cells
{
public int value = 0;
public int color = 0;
public int background = 0;

}
public class Rows
{
public Cells [] cell = new Cells [10];
public int row_num;
}

public class Matrix
{
public Rows []row = new Rows [100];
public int new_id;
// Constructor
public Matrix (){
. . .
for (int i=0; i<10; i++){
for (int j=0; j<10; j++){
row.cell[j] = i+j;
}
}
. . .
}

}

Creation of class Matrix element

Matrix mtr = new Matrix();
causes Error in Constructor in “row[i].cell[j] = i+j;”
“Object reference not set to an instance of an object”.
Rows are nulls and Cells are missing entirely when I tried to watch an
Object!!!

Obviously something missing in Constructor, but I have no idea how to
fix it.

Please help

:cry:
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
1 1498
It wierd
http://www.groupsrv.com/dotnet/viewforum.php?f=

and this are sending each other posts
It's a good idea to incresae traffik!! :-)

But problem persists, unfortunately.. :-((
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Desperate | last post by:
I want to create class Matrix which contains array of class Rows and some additions Class Rows contains array of Cells Here is the declaration public class Cell public int value = 0...
5
by: SStory | last post by:
Hi all, I really needed to get the icons associated with each file that I want to show in a listview. I used the follow modified code sniplets found on the internet. I have left in...
7
by: Ron | last post by:
Hello, I have 4 classes that use 4 DTS packages on 4 different tables. So I have Dim cls1 As New clsDTS1, cls2 As New clsDTS2 Dim cls3 As New clsDTS3, cls4 As New clsDTS4 Each class has a...
18
by: Sam | last post by:
Hi All I'm planing to write an application which allows users dynamically add their points (say you can add upto 30,000) and then draw xy graph. Should I use an array for my coordinate point...
11
by: TG | last post by:
Hi there. I'm trying to create a simple class called Vector which inherit from array. class Vector(array): def __init__(self,length): """initialize a vector of random floats of size length....
3
by: Ben | last post by:
Hi, I am trying to create a specific structure, but having problems with the type definitions. Basically it's an array of trees. Each element of the array should be a binary tree of type...
7
by: heddy | last post by:
I have an array of objects. When I use Array.Resize<T>(ref Object,int Newsize); and the newsize is smaller then what the array was previously, are the resources allocated to the objects that are...
4
by: mountain.dog | last post by:
Hi There, I'm trying to understand inheriting properties object and I'm not fully understanding the ways to accomplish this. For example, I have a PHP array that is generate in "class a". I...
2
by: rookiejavadude | last post by:
I'm have most of my java script done but can not figure out how to add a few buttons. I need to add a delete and add buttong to my existing java program. Not sure were to add it on how. Can anyone...
2
by: hcaptech | last post by:
This is my Test.can you help me ? 1.Which of the following statement about C# varialble is incorrect ? A.A variable is a computer memory location identified by a unique name B.A variable's name...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.