473,406 Members | 2,467 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,406 software developers and data experts.

what does this mean?

82
Hi

I'm trying to work out what this is doing

int[,] kernel = { { -1, -1, -1 }, { -1, 8, -1 }, { -1, -1, -1 } };
int ksize = kernel.GetLength(0);


What I think is happening is:

The first line declares a dynamic multidimensional array of integers called kernal and puts the values { -1, -1, -1 }, { -1, 8, -1 }, { -1, -1, -1 } in it (3 rows of 3).
The second line declares an int called ksize and puts the length of kernal into it.

But is the length of kernal 3 or 9?
and what is (0) on the kernel.GetLength(0) used for?

mrcw
Nov 27 '09 #1

✓ answered by tlhintoq

Rather than tell you the answer how about if we show you a way to learn the answers?

But is the length of kernal 3 or 9?
Expand|Select|Wrap|Line Numbers
  1. int ksize = kernel.GetLength(0); 
Check/display the value of ksize in your application. You could have a messagebox show you the value:
Expand|Select|Wrap|Line Numbers
  1. MessageBox.Show(ksize.ToString(), "The value is...");
what is (0) on the kernel.GetLength(0) used for?
Whenever you want to know something about the .NET framework a good place to start is the MSDN. For this question specially you can find the answer here:
http://msdn.microsoft.com/en-us/libr...getlength.aspx

4 2436
Banfa
9,065 Expert Mod 8TB
Is this by any chance C#?

Although quite C like it is certainly not C or C++.
Nov 27 '09 #2
mrcw
82
Sorry put it in wrong place
Nov 27 '09 #3
tlhintoq
3,525 Expert 2GB
Rather than tell you the answer how about if we show you a way to learn the answers?

But is the length of kernal 3 or 9?
Expand|Select|Wrap|Line Numbers
  1. int ksize = kernel.GetLength(0); 
Check/display the value of ksize in your application. You could have a messagebox show you the value:
Expand|Select|Wrap|Line Numbers
  1. MessageBox.Show(ksize.ToString(), "The value is...");
what is (0) on the kernel.GetLength(0) used for?
Whenever you want to know something about the .NET framework a good place to start is the MSDN. For this question specially you can find the answer here:
http://msdn.microsoft.com/en-us/libr...getlength.aspx
Nov 27 '09 #4
mrcw
82
already figured out that was thig to do
Nov 28 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
3
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification...
86
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
2
by: Steve Richter | last post by:
What does the "." mean in the following sql script stmts? use GO if exists (select * from dbo.sysobjects where id = object_id(N'.') and OBJECTPROPERTY(id,N'IsUserTable') = 1) drop table ....
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
51
by: jacob navia | last post by:
I would like to add at the beginning of the C tutorial I am writing a short blurb about what "types" are. I came up with the following text. Please can you comment? Did I miss something? Is...
1
by: Frank Rizzo | last post by:
Some of the classes in the framework are marked as thread-safe in the documentation. In particular the docs say the following: "Any public static (*Shared* in Visual Basic) members of this type...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
9
by: JoeC | last post by:
m_iWidth = (int)pBitmapInfo->bmiHeader.biWidth; m_iHeight = (int)pBitmapInfo->bmiHeader.biHeight; What does this mean? I have seen v=&var->member.thing; but what does it mean when you...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.