In theory these are called storage classes. These will define the scope and life time of variables or functions.<br><br>There are mainly 4 of them:<br><br>auto is the default storage class for local variables. <br><br>register is used to define local variables that should be stored in a register instead of RAM. This means that the variable has a maximum size equal to the register size say a word.<br><br>static can also be defined within a function or as a global variable. If this is done, the variable is initalised at compilation time and retains its value between calls ie, inside the function. Because it is initialsed at compilation time, the initalistation value must be a constant. This is serious stuff - tread with care. <br><br>extern defines a variable as global one ie, that is visable to all files irrespective of where it is defined. When you use 'extern' the variable cannot be initalized as all it does is point the variable name at a storage location that has been previously defined. <br>
C++
Topic: Variable
what are auto static variables and auto extern variables?
Browse random answers:
Scope of variables
Explain about Initialization of variables ?
Explain about Variable Declaration in C++ ?
Explain about Variable Initialization in C++:
Explain about Initializing Local and Global Variables ?
Explain about Global Variables ?
Explain about Calculations and variables ?
Why global variables are evil ?
How to store letters in a variable?
declaring floating-point type variables
What are variable declaration in c++ syntax ?
Write a function using reference variables as arguments to swap the values of a pair of integers?
How to access change a variable using pointer in C++?
Write a program to declare two integer , one float variables and assign 10, 15, and 12.6 to them respectively. It then prints these values on the screen.
What is a Variable?
What is an algorithm (in terms of the STL/C++ standard library)?
what are auto static variables and auto extern variables?
How many ways are there to initialize an int with a constant?
How do you decide which integer type to use?
How is static variable stored in the memory?( if there are 2 functions in a file,and the static variable name is same (ex var) in both the function. how is it keep seperately in the memory).
What can I safely assume about the initial values of variables which are not explicitly initialized?
What?s the auto keyword good for?
What is the difference between declaration and definition?
How variable declaration in c++ differs that in c?
What is difference between followin intialization.int iVar1;int iVar2 = int();and which one of two should we prefer always and why?
Are private class-level variables inherited?
Are there any new intrinsic (built-in) data types?
I was trying to use an "out int" parameter in one of my functions. How should I declare the variable that I am passing to it?
When you inherit a protected class-level variable, who is it available to?
What is a node class in c++?
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator.
Explain about Variables Data Types ?
Explain about Fundamental data types ?
Explain about Declaration of variables ?