In which memory a class gets stored(in heap /in stack)?
And why??

Answer Posted / ravi.g

Usually class will get stored when the object/s are created.

Class will get sored in stack segment when the object is
created inside the functions.

When objects are created globally they will get stored in
the data segment.

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is searching? Explain linear and binary search.

668


Write a program using display() function which takes two arguments.

702


What it is and how it might be called (2 methods).

748


Define stacks. Provide an example where they are useful.

679


What is a stack c++?

662






What are the advantages of pointers?

683


When can I use a forward declaration?

707


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3467


What is auto used for in c++?

667


Can c++ be faster than c?

691


Why was c++ made?

750


Is it possible for the objects to read and write themselves?

746


Can a constructor return a value?

676


What are dynamic type checking?

696


Can you pass an array to a function in c++?

628