From 1a0ab8a5b946ae3c749b977a866f72ebd5958cfe Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Tue, 26 Mar 2024 19:09:26 -0700 Subject: [PATCH] Fix Listing 3.16 --- Errata.md | 3 ++- ...idimensionalArrayWithInconsistentSizeCausingAnError.cs | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Errata.md b/Errata.md index 5587e30aa..d06ff65b2 100644 --- a/Errata.md +++ b/Errata.md @@ -17,4 +17,5 @@ Zhou Jing | 3 | 110 | Replace `System.Value` with `System.ValueTuple` i Zhou Jing | 3 | 102 | Change Listing 2.18 to " the Working with Strings listing in Chapter 2 (Listing 2.24)" in "This listing differs from Listing 2.18 in two ways" Zhou Jing | 3 | 102 | Changed 'restrictive' to 'less restrictive' in "In each of these cases, the variable declaration is restrictive because the variable may be assigned." Zhou Jing | 23 | 1077 | Change "Point Declaration" to "Pointer Declaration" in mindmap -Zhou Jing | 22 | 1074 | Change "Chapter 19" to "Chapter 20" in "we pointed out in Chapter 19" \ No newline at end of file +Zhou Jing | 22 | 1074 | Change "Chapter 19" to "Chapter 20" in "we pointed out in Chapter 19" +Zhou Jing | 4 | 119 | Show inconsistent size multi-dimensional array in listing 3.16 \ No newline at end of file diff --git a/src/Chapter03/Listing03.16.AMultidimensionalArrayWithInconsistentSizeCausingAnError.cs b/src/Chapter03/Listing03.16.AMultidimensionalArrayWithInconsistentSizeCausingAnError.cs index cb65ba13d..03a92bab7 100644 --- a/src/Chapter03/Listing03.16.AMultidimensionalArrayWithInconsistentSizeCausingAnError.cs +++ b/src/Chapter03/Listing03.16.AMultidimensionalArrayWithInconsistentSizeCausingAnError.cs @@ -6,18 +6,14 @@ public static void Main() { #region INCLUDE // ERROR: Each dimension must be consistently sized - #region EXCLUDE - /* - #endregion EXLUDE + #if COMPILEERROR // EXCLUDE int[,] cells = { {1, 0, 2, 0}, {1, 2, 0}, {1, 2}, {1} }; - #region EXCLUDE - */ - #endregion EXCLUDE + #endif // COMPILEERROR // EXCLUDE #endregion INCLUDE } }