Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Ivor Horton's Beginning Visual C++ 2005
Password Reminder
Register
| FAQ | Members List | Calendar | 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 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 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.

  #2 (permalink)  
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

 


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
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



All times are GMT -4. The time now is 07:49 PM.


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