forked from nicolas-flasque-efrei/MARC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack.h
48 lines (40 loc) · 834 Bytes
/
stack.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Created by flasque on 19/10/2024.
//
#ifndef UNTITLED1_STACK_H
#define UNTITLED1_STACK_H
/**
* @brief Structure for the stack of integers
*/
typedef struct s_stack
{
int *values;
int size;
int nbElts;
} t_stack;
/**
* @brief Function to create a stack
* @param size : the size of the stack
* @return the stack
*/
t_stack createStack(int);
/**
* @brief Function to push a value in the stack
* @param pointer to the stack
* @param value : the value to push
* @return none
*/
void push(t_stack *, int);
/**
* @brief Function to pop a value from the stack
* @param : pointer to the stack
* @return the value popped
*/
int pop(t_stack *);
/**
* @brief Function to get the top value of the stack
* @param stack : the stack
* @return the top value
*/
int top(t_stack);
#endif //UNTITLED1_STACK_H