In computer science, a data structure that works according to the Last-In-First-Out principle (LIFO). Elements are placed on top of the stack and removed from there as well.
example
Bei einem Funktionsaufruf werden die lokalen Variablen auf dem Stack gespeichert.
During a function call, the local variables are stored on the stack.
Usage tips
English loanword
The word 'Stack' is taken directly from English and literally means 'stack' or 'pile'. In German, it is used almost exclusively as a technical term in specific fields.
EXAMPLE
In der Programmierung ist der Stack eine fundamentale Datenstruktur.
In programming, the stack is a fundamental data structure.
Context clue
You can almost always recognize the meaning of 'Stack' from context. In conversations about programming, it refers to the data structure; in gaming, to a stack of items; and in geography, to a rock formation.
EXAMPLE
Der Programmierer erklärte den Unterschied zwischen Stack und Heap.
The programmer explained the difference between stack and heap.
Use in IT
In a computer science context, 'Stack' is often used with the prepositions 'auf' (on/onto) and 'von' (from). You put data 'auf den Stack' (onto the stack; push operation) and retrieve it 'vom Stack' (from the stack; pop operation).
EXAMPLE
Bei jedem neuen Funktionsaufruf wird ein neuer Frame auf dem Stack angelegt.
With each new function call, a new frame is created on the stack.
Use in gaming
In gaming jargon, people often talk about having 'einen vollen Stack' (a full stack) of something. This means the maximum possible number of an item that can be stacked in a single inventory slot.
EXAMPLE
Ich brauche noch zehn Eisen, dann habe ich einen vollen Stack.
I need ten more iron, then I'll have a full stack.
Compare with
near_synonym · confusable
Stack vs Keller
basement
'der Keller' and 'der Stack' can both have to do with storing things, but they do not mean the same thing. A 'Keller' is a room in the lower part of a building, often underground. It is where you store things like boxes, tools, or drinks. A 'Stack' is a pile or bundled amount of identical things, especially in computer games. Learners might confuse the words when the topic is stored items in general. In practice: 'der Keller' is the place, while 'der Stack' is the amount or pile.
Stack
Im Spiel legt der Gast einen neuen Stack Holz in sein Inventar.
In the game, the guest puts a new stack of wood in his inventory.
Keller
Am Abend holt er die Winterjacken aus dem Keller.
In the evening, he gets the winter jackets from the basement.