When you define a integer it gets stored in which data
structure?(Stack or a heap)

Answer Posted / shyam

Depends on where the integer is declared. If it s declared in a block it goes into stack.

If it s an static or global variable, it will not be stored in stack. It ll be stored in data segment of the running program.

Integer will never be stored in heap... never...

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a destructor be called directly?

613


How long to learn object oriented programming?

579


Is react oop?

618


How do you explain polymorphism?

600


Can you inherit a private class?

645






write a program to find 2 power of a 5digit number with out using big int and exponent ?

1907


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1403


How do you achieve polymorphism?

622


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2768


Why do we use oops?

601


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1629


What are the three parts of a simple empty class?

1470


Is data hiding and abstraction same?

578


What is new keyword in oops?

601


What language is oop?

603