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

Definition of Stack

By , About.com Guide

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

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.