Skip to main content
  • 11k Accesses

Abstract

In the first three chapters, we embark on a practical study of computation. Our goal is to develop and understand a simple but expressive model of computation that will underlie the material in the remainder of this book—and on which you can subsequently draw when learning more advanced programming skills and concepts. In the first chapter, we introduce memory; in the second, procedure. In the third, we combine memory and procedure to study two basic data structures.

Whereas a traditional programming course reserves “pointers” for late in the semester and may not even mention the stack, let alone how function calling works, this chapter covers both—for two reasons. First, manipulating memory is fundamental to practical programming, yet many students, through lack of practice, leave their first programming course unable to do so effectively. By introducing memory manipulation in the first week, students have a full semester to master the topic. Second, the correct usage of call-by-value, call-by-reference, pointers, and arrays is crucial for writing anything but the simplest of programs. Rather than taking an abstract and rule-based perspective, this chapter covers the program stack and the function call protocol, which naturally give rise to these concepts. A mechanistic understanding of computation lays the foundations for the powerful abstraction methodologies that come later.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 69.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Aaron R. Bradley .

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Bradley, A.R. (2011). Memory: The Stack. In: Programming for Engineers. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-23303-6_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-23303-6_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-23302-9

  • Online ISBN: 978-3-642-23303-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics