Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming 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
  #1 (permalink)  
Old April 28th, 2005, 12:37 PM
Registered User
 
Join Date: Apr 2005
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
Default Stack segment

Stack function often used by compiler to implement a function, but the question is, does the compiler make use of it when main() is invoked? thanks...

Precision is not truth!
Reply With Quote
  #2 (permalink)  
Old April 29th, 2005, 01:59 AM
Authorized User
 
Join Date: Mar 2005
Posts: 58
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to Alan-LB Send a message via Yahoo to Alan-LB
Default

Yes. Variables declared outside of main() (and any other function) are global and are allocated in the data segment. Variables declared within main() are allocated on the stack as in any other function. The space is released when main() terminates - which is when the program terminates.

Alan


Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Different color for a piechart segment ??? harifsheik C# 2005 3 July 30th, 2008 02:40 AM
How can I set ROLLBACK SEGMENT of Oracle in SSIS? Samuel Choi SQL Server DTS 1 August 14th, 2007 07:39 AM
How can I set ROLLBACK SEGMENT of Oracle in SSIS? Samuel Choi SQL Server 2005 0 March 8th, 2006 04:55 AM
Excel 2003: How to remove line segment in chart James Peng Excel VBA 0 October 22nd, 2004 05:03 PM
Inserting just the time segment Trojan_uk SQL Server ASP 1 April 15th, 2004 10:03 AM





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