What are the basics of classifying different storage types,
why?
Answer Posted / 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 |
Post New Answer View All Answers
Can member data be public?
Define linked lists with the help of an example.
What is DlgProc?
Can non-public members of another instance of the class be retrieved by the method of the same class?
Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D
Is it possible to get the source code back from binary file?
Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be
Explain stack & heap objects?
What are built-in functions? What is the syntax for the definition?
Write a Program to find the largest of 4 no using macros.
What is pointer -to-members in C++? Give their syntax?
Explain Text Manipulation Routines?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.
Is c# written in c++?
What jobs can you get with a c++ certification?