logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • Explain static and dynamic memory allocation with an example each.


  • Correct Answer
  • When amount of memory to be allocated is known beforehand ie at the the time of compilation, it is known as Static Memory Allocation Once the memory is allocated statically, it cannot be deallocated during program run So it leads to wastage of storage space Example: int A[100]; When amount of memory to be allocated is not known beforehand, rather it is determined at the time of program run, it is called Dynamic Memory Allocation It leads to efficient utilization of storage space Example: cout << " Enter number of elements: "; cin >> N; int *A = new int[N]; // dynamic memory allocation 


  • Technology problems


    Search Results


    • 1. What is the difference between Tags and HTML Elements ?
    • Discuss
    • 2. How can you make sure the web application is fit for release ?
    • Discuss
    • 3. What is the importance of finally block in exception handling ?
    • Discuss
    • 4. Should a main() method be compulsorily declared in all java classes?
    • Discuss
    • 5. Which of the following is not the member of class?

    • Options
    • A. Virtual function
    • B. Static function
    • C. Friend function
    • D. Const function
    • Discuss
    • 6. Why static methods cannot access non static variables or methods?
    • Discuss
    • 7. What is String Args in Java?
    • Discuss
    • 8. The syntax of capture events method for document object is..
    • Discuss
    • 9. What is the role of the JIT compiler in .NET Framework?
    • Discuss
    • 10. Which of the following gives the memory address of the first element in array?

    • Options
    • A. array[0];
    • B. array[1];
    • C. array(2);
    • D. array;
    • Discuss


    Comments

    There are no comments.

Enter a new Comment