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

What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

647


What is the main purpose of c++?

539


What is runtime polymorphism in c++?

580


When to use “const” reference arguments in a function?

575


What is long in c++?

731






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

923


What is private inheritance?

592


Name four predefined macros.

592


What is a driver program?

625


What can I safely assume about the initial values of variables which are not explicitly initialized?

617


What can c++ be used for?

578


Can we use clrscr in c++?

526


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

628


What are pointer-to-members? Explain.

622


What is oop in c++?

595