Categories:
.NET (357)
C (330)
C++ (184)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (2)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What’s the auto keyword good for?
What’s the auto keyword good for?
✍: Guest
Answer1
Not much. It declares an object with automatic storage duration. Which means the object will be destroyed at the end of the objects scope. All variables in functions that are not declared as static and not dynamically allocated have automatic storage duration by default.
For example
int main()
{
int a; //this is the same as writing “auto int a;”
}
Answer2
Local variables occur within a scope; they are “local” to a function.
They are often called automatic variables because they
automatically come into being when the scope is entered and
automatically go away when the scope closes. The keyword auto
makes this explicit, but local variables default to auto auto auto auto so it is never
necessary to declare something as an auto auto auto auto.
2012-03-08, 2873👍, 0💬
Popular Posts:
How To Enter Boolean Values in SQL Statements? - MySQL FAQs - Introduction to SQL Basics If you want...
What are unadjusted function points and how is it calculated? Unadjusted function points = ILF + EIF...
What is page thrashing? Some operating systems (such as UNIX or Windows in enhanced mode) use virtua...
How To Increment Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...
In below sample code if we create a object of class2 which constructor will fire first? Public Class...