Solved

Auto Array in C++ ?

Posted on 2003-10-25
1
1,213 Views
Last Modified: 2012-05-04
To C++ Expert :

   What is an auto-array ? Is it the same as static array ? How does it be initialized ? Are they initialized on heap or stack ? Thanks a lot !

meow .....
0
Comment
Question by:meow00
1 Comment
 
LVL 1

Accepted Solution

by:
Mustak_Shaikh earned 40 total points
ID: 9620361
Auto-array is a normal array which we commonly use in C++ or any other language.
it is basically initialize on stack. it is initialize as usual in following way:
int intNum[] = {10,20,90};
it is not same as static array.
A static array is array which is initialized only once i.e.
 void func()
{
        static int intNum[] = {10,20,90};   //line-1
       // other code   //line-2
     //
}
when i call this function for the first time ,only at that time only line-1 will
get executed and for rest of the the function will execute from line-2 onwards.
What it mean is that when ever i am revisiting this function it will retain the last stored value of intNum array, will not destroy this lastly stored value by executing line-1

regards,
Mustak_Shaikh
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
countX 22 84
WMI, model #, retrieving information 10 118
Path of Workbook 3 61
oracle query help 18 99
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is an explanation of a simple data model to help parse a JSON feed
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now