Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3
This is the forum to discuss the Wrox book Beginning C# 3.0 : An Introduction to Object Oriented Programming by Jack Purdum; ISBN: 9780470261293
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 18th, 2010, 11:32 PM
Authorized User
 
Join Date: Feb 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 8: initializing multidimension arrays

hi

on pg 195
int[,] myData = new int[,] {1,2,3},{4,5,6}

assuming that to define a 2 dimensional array i have to use two [,] but
it doesnt exist in the next example under "some programmers find it useful ..."
int [] myData = new int[,] {

{1,2,3},
{4,5,6}
};
  #2 (permalink)  
Old February 19th, 2010, 01:14 AM
Friend of Wrox
Points: 1,166, Level: 13
Points: 1,166, Level: 13 Points: 1,166, Level: 13 Points: 1,166, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2008
Location: Indianapolis, IN, USA.
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Typo

The second version in the book:

int [] myData = new int[,] {
{1,2,3},
{4,5,6}
};

has a typo in it. The first pair of brackets need the missing comma. It should be:

int [,] myData = new int[,] {
{1,2,3},
{4,5,6}
};

Sorry for the hiccup...
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
initializing variables vin_0x1 Classic ASP Components 2 April 16th, 2006 07:59 PM
Chapter 2: Adding Arrays Invincible Pear BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 4 January 2nd, 2006 07:25 AM
Error whilst initializing the report server lidsurfer BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 November 3rd, 2004 05:17 PM
Initializing a database davest Access 4 January 16th, 2004 10:08 AM



All times are GMT -4. The time now is 01:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.