Wrox Programmer Forums
|
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 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 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}
};
 
Old February 19th, 2010, 01:14 AM
Friend of Wrox
 
Join Date: Sep 2008
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)





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





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