What are the basics of classifying different storage types,
why?
Answers were Sorted based on User's Feedback
Answer / sv
Automatic
External
Static
Register
Automatic is local storage applied for local variables.
External is global variable,which shall be accessed through
out the program at any modules.
Static retains its values and live till end of the program,
but not visible to all modules, hence accessible with in
the scope.
Register: In few program, where performance is high
importance we can use register storage, so that access
overhead is less.In this storage type , an varible always
uses the register for read/write.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / prit
The different storage types in C++ are
Auto: all the variables declared in C++ are of the type
auto by default
The scope is limited to the loop
int temp; //is by default of type auto
Register: tels the C++ compiler to allocate some storage in
the registers.They are supposed to be faster then other
storage types.
register int var;
Only nonstatic, local variables may reside in registers,
and C++ uses the same rules for register variable scope and
initialization as it does with automatic variables
Mutable:const memebre functions or data types can be
modified using mutable keyword.
mutable int i;
static:static variable is declared as a member of a class,
then it will preserve the value for all the objects of the
class.i.e, one copy of this data variable will be shared by
all objects of the class.
static int temp;
extern : extern keyword is used to specify that the
variable is declared in a different file.Used mostly to
declare global scope
extern int num;
| Is This Answer Correct ? | 0 Yes | 0 No |
What are compilers in c++?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
How do you print for example the integers 3,2,1,5,4 in a binary tree within the console in format where it looks like an actual binary tree?
Explain Memory Allocation in C/C++ ?
What is extern c++?
What is functions syntax in c++?
What is a c++ object?
What are the effects after calling the delete this operator ?
What is the average salary of a c++ programmer?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
Explain about Virtual Function in C++?
Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort