Search Interview Questions
Question:
What are C++ storage classes?
Answer:
auto
register
static
extern
auto: the default. Variables are automatically created and initialized when they are defined
and are destroyed at the end of the block containing their definition. They are not visible
outside that block
register: a type of auto variable. a suggestion to the compiler to use a CPU register for
performance
static: a variable that is known only in the function that contains its definition but is
never destroyed and retains its value between calls to that function. It exists from the
time the program begins execution
extern: a static variable whose definition and placement is determined when all object and
library modules are combined (linked) to form the executable code file. It can be visible
outside the file where it is defined.
|
|||||||||||
Question: What are C++ storage classes? Answer:
Automatic, Static and Allocated. Source: CoolInterview.com ![]() ![]() If you have the better answer, then send it to us. We will display your answer after the approval Rules to Post Answers in CoolInterview.com:-
|
Related Questions | ||
What is conversion constructor? |
|
|
What are all the implicit member functions of the class? Or what are all the functions which compiler implements for us if we don't define one.?? |
|
|
When are copy constructors called? |
|
|
What is a Makefile? |
|
|
What does extern mean in a function declaration? |
|
|
Will it execute or not? C++ Interview Questions and Answers (Continued from previous question...) Will it execute or not? void main() { char *cptr = 0?2000; long *lptr = 0?2000; cptr++; lptr++; printf(? %x %x?, cptr, lptr); }Will it execute or not? |
|
|
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array? How can you find the nodes with repetetive data in a linked list? |
|
|
What is the difference between Mutex and Binary semaphore? |
|
|
What methods can be overridden in Java? |
|
|
What is the Standard Template Library (STL)? |
|
|
Can you be bale to identify between Straight- through and Cross- over cable wiring? and in what case do you use Straight- through and Cross-over? |
|
|
How many ways are there to initialize an int with a constant? |
|
|
What can I safely assume about the initial values of variables which are not explicitly initialized? |
|
|
What is RTTI? |
|
|
What are the differences between a C++ struct and C++ class? |
|
|
How do you link a C++ program to C functions? |
|
|
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator. |
|
|
You?re given a simple code for the class BankCustomer. Write the following functions ... You?re given a simple code for the class BankCustomer. Write the following functions: * Copy constructor * = operator overload * == operator overload * + operator overload (customers? balances should be added up, as an example of joint account between husband and wife) |
|
|
What are the defining traits of an object-oriented language? |
|
|
Why are arrays usually processed with for loop? |
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All C++ Interview Questions & Answers - Exam Mode / Learning Mode
India News Network |