Generally variables are stored in heap memory. When he
variables are created in stack?

Answer Posted / suneet

According to the C standard the storage will be.
1.variable with storage class 'auto' ie., local to the
function - in stack memory.
2.variable with storage class when 'extern' and 'static' are initialized stored in data segment otherwise found in bss.
3.variable with storage class 'register' in processor
register. But this register variable will be treated as
auto when there is no enough memory in the processor.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we change the basic meaning of an operator in c++?

894


What are the vectors in c++?

843


What is #include iostream?

1019


Differentiate between realloc() and free().

814


Define what is constructor?

843


What is ifstream c++?

837


How many characters are recognized by ANSI C++?

1186


How can you specify a class in C++?

1048


Explain one method to process an entire string as one unit?

1252


Assume an array of structure is in order by studentID field of the record, where student IDs go from 101 to 500. Write the most efficient pseudocode algorithm you can to find the record with a specific studentID if every single student ID from 101 to 500 is used and the array has 400 elements. Write the most efficient pseudocode algorithm you can to find a record with a studentID near the end of the IDs, say in the range from 450 to 500, if not every single student ID in the range of 101 to 500 is used and the array size is only 300

2029


Where must the declaration of a friend function appear?

772


What is else if syntax?

918


Explain differences between alloc() and free()?

833


What is a tuple c++?

780


Is c++ primer good for beginners?

825