Push erstellt.

This commit is contained in:
Jochen Duernberger 2025-12-11 08:26:46 +01:00
parent 416f44ae74
commit 5072f82928
16 changed files with 72 additions and 5 deletions

40
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,40 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug test_stack",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/test_stack.exe",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "C:/ProgramData/mingw64/mingw64/bin/gdb.exe",
"preLaunchTask": "Build via Makefile"
},
{
"name": "Debug test_numbers",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/test_numbers.exe",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "C:/ProgramData/mingw64/mingw64/bin/gdb.exe",
"preLaunchTask": "Build via Makefile"
},
{
"name": "Debug test_bintree",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/test_bintree.exe",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "C:/ProgramData/mingw64/mingw64/bin/gdb.exe",
"preLaunchTask": "Build via Makefile"
}
]
}

27
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,27 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build via Makefile",
"type": "shell",
"command": "mingw32-make",
"args": ["${input:target}"],
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$gcc"
}
],
"inputs": [
{
"id": "target",
"type": "pickString",
"description": "Welches Makefile-Target soll gebaut werden?",
"options": ["test_stack", "test_numbers", "test_bintree", "doble", "unitTests"]
}
]
}

BIN
bintree.o

Binary file not shown.

BIN
doble

Binary file not shown.

BIN
doble.exe Normal file

Binary file not shown.

Binary file not shown.

BIN
doble_initial.exe Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +1,10 @@
Player1;19887
Lena;19811 Lena;19811
Lena;19702 Lena;19702
Player1;19578
player_name;9981 player_name;9981
Lena;9980 Lena;9980
Lena;9978 Lena;9978
Lena;9978 Lena;9978
Lena;9976 Lena;9976
Lena;9975 Lena;9975
Lena;9971
Lena;9965

BIN
main.o

Binary file not shown.

BIN
numbers.o

Binary file not shown.

View File

@ -1,15 +1,15 @@
#include <stdlib.h> #include <stdlib.h>
#include "stack.h" #include "stack.h"
// Pushes data as pointer onto the stack. // Push Daten auf den Stack legen.
StackNode *push(StackNode *stack, void *data) StackNode *push(StackNode *stack, void *data)
{ {
StackNode *node = (StackNode *)malloc(sizeof(StackNode)); StackNode *node = (StackNode *)malloc(sizeof(StackNode));
if(node == NULL) if(node == NULL)
return stack; // allocation failed -> return unchanged stack return stack; // allocation failed -> return unchanged stack
node->data = data; node->data = data; // Set the data for the new node
node->next = stack; node->next = stack; // New node points to the previous top of the stack
return node; return node;
} }

BIN
stack.o

Binary file not shown.

Binary file not shown.

BIN
test_stack.exe Normal file

Binary file not shown.

BIN
timer.o

Binary file not shown.