Online Programming Server

Login

Login with facebook [?]

Facebook

Tutorial 76: Chapter 4 - Dynamic Memory Allocation

You are here: Tutorials >> Basic >> C >> C Programming Basics >> Chapter 4 - Dynamic Memory Allocation

Tutorial ID76
TitleChapter 4 - Dynamic Memory Allocation

It's array again!

  • As mentioned before
    • A statically declared array is fixed in size, i.e. the size of a statically declared array MUST be known at compile time
  • In real applications, it is not always easy or even impossible to estimate how many elements we will need to use
  • We usually need to deal with an arbitrary amount of data input
    • Over estimate
      • Waste of memory / Memory inefficient
    • Underestimate
      • Overflow / Exception / Error -> Fails to get the job done
  • One size doesn’t suit all case...

Post Your Comment

Title
Message