Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Ivor Horton's Beginning Visual C++ 2005
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2005 by Ivor Horton; ISBN: 9780764571978
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual 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 May 28th, 2006, 04:26 AM
Authorized User
 
Join Date: May 2006
Location: Iver, Bucks., United Kingdom.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page 91 of book: Global Variables.

Text refers to Figure 2.12 in 3rd paragraph, but Figure 2.12 on page 92 does not tie up with the description.

 
Old June 24th, 2006, 10:48 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Nick Y
 Text refers to Figure 2.12 in 3rd paragraph, but Figure 2.12 on page 92 does not tie up with the description.
Exactly.

The variable value1, which appears at the beginning of the file, is declared at global scope, as is
value4, which appears after the function main(). The scope of each global variable extends from the
point at which it is defined to the end of the file. Even though value4 exists when execution starts, it
cannot be referred to in main() because main() is not within the variable’s scope. For main() to use
value4, you would need to move its declaration to the beginning of the file. Both value1 and value4
will be initialized with 0 by default, which is not the case for the automatic variables. Note that the local
variable called value1 in function() hides the global variable of the same name.


There is no value4, and the description doesnt match up with Fig. 2-12





Similar Threads
Thread Thread Starter Forum Replies Last Post
global variables Komila ASP.NET 3.5 Basics 2 October 31st, 2008 01:14 PM
Global Variables in C# su C# 2 December 11th, 2006 06:18 PM
Global variables zarol Beginning PHP 3 May 10th, 2005 06:17 AM
Global variables ps124 ASP.NET 1.0 and 1.1 Basics 6 April 6th, 2004 02:48 PM





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