C / C++ / C#

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

Definition of Stack

By David Bolton, About.com

Definition: Modern CPUs use a stack based architecture for handling function calls and parameter handling.

A stack is a list like structure where stack items can only be added or removed from the end of the stack. Just like a plate stack in canteens where plates are added to the top and later removed from the top.

When a function is called, the address of the next instruction is pushed onto the stack. When the function exits, the address is popped off the stack and execution continues at that address.

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Also Known As: Last In First Out (LIFO)
Examples: In C and C++, variables declared locally (or auto) are stored on the stack.

Explore C / C++ / C#

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

C / C++ / C#

  1. Home
  2. Computing & Technology
  3. C / C++ / C#
  4. Glossary
  5. S
  6. Stack - Definition

©2009 About.com, a part of The New York Times Company.

All rights reserved.