In which memory a class gets stored(in heap /in stack)?
And why??
Answers were Sorted based on User's Feedback
The stack is a place in the computer memory where all the variables that are declared and initialized before runtime are stored. The heap is the section of computer memory where all the variables created or initialized at runtime are stored.
Hence,classes will be stored in heap memory.
Is This Answer Correct ? | 6 Yes | 3 No |
Answer / 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 |
Difference between Top down and bottom up approaches for a given project ?
14 Answers BSNL, CSC, HCL, HP, IIT, Infosys, Siemens,
How to change constant values?
Design a program to input a date from user in the form day/month/year (e.g. 2/6/2000) and report whether it’s a valid date or not. The program should take account of leap years. You will need to know that a leap year is a year that is exactly divisible by 4, except that century years are only leap years if they are divisible by 400.
How would you use the functions sin(), pow(), sqrt()?
What are the extraction and insertion operators in c++?
3- Write a program to find larger and smaller of the two numbers.
What is a class template in c++?
What is the Standard Template Library?
Write a program that will count the number of digits in an input integer up to value MAX_VALUE (2147483647). Thus, for an input of 5837 the output should be 4 digits Make sure that your program works for the numbers 0, 1, and 10. For the number 0, the output should be 1 digit
Explain pass by value and pass by reference.
What happens when a function throws an exception that was not specified by an exception specification for this function?
What is the meaning of c++?