Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 5th, 2008, 06:27 AM
Authorized User
Join Date: Aug 2007
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yukijocelyn
Default Byte array's ".getLength" and ".Length"


byte[] testing = new byte[100];
I am confused with these 2 methods. What will I get if I do a testing.getLength & testing.Length?

Old August 5th, 2008, 06:34 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts



Joe (Microsoft MVP - XML)
Old August 5th, 2008, 06:35 AM
Friend of Wrox
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post

Erm, did you try reading the tooltip on the Intellisense when typing?

Or perhaps just be spontaneous and type the code and examine the results?

Admittedly, I have never used GetLength so I needed to look it up, it took me longer to write the first line of this post..

Old August 5th, 2008, 06:45 AM
samjudson's Avatar
Friend of Wrox
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts

Try reading the documentation (RTFM!):




There is a difference, but only when used on multi-dimensional arrays.

p.s. Nice link Joe :)

/- Sam Judson : Wrox Technical Editor -/
Old August 6th, 2008, 12:31 PM
Authorized User
Join Date: Aug 2007
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yukijocelyn

Hi samjudson!

Thank you for replying! I understand already!

Thank you so much!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting int to byte yukijocelyn C# 2005 1 May 30th, 2008 03:44 AM
change only the first item in array's back color i remya1000 .NET Framework 1.x 1 November 5th, 2007 10:43 PM
Byte alignment or byte padding subodh_chettri C++ Programming 0 June 23rd, 2006 10:35 AM
Printing byte[] safin XSLT 3 October 10th, 2005 07:12 AM
Chapter 6 Array's "Going backwards" mjennings VB.NET 2002/2003 Basics 2 November 19th, 2003 02:18 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.