Skip to content
Snippets Groups Projects
Commit c5315913 authored by dario.genga's avatar dario.genga
Browse files

Add stack's methods signature

Also fixed some typos in comments or define.
parent 96796f92
Branches
No related tags found
No related merge requests found
...@@ -17,6 +17,6 @@ Use this command to compile the project. ...@@ -17,6 +17,6 @@ Use this command to compile the project.
Use this command to clean the project. Use this command to clean the project.
### Run the tests ### Run the tests
> `make run_tests` > `make test`
Use this command to start the tests. Use this command to start the tests.
\ No newline at end of file
/* Author : Dario GENGA /* Author : Dario GENGA
* Date : 16.11.2021 * Date : 23.11.2021
* Description : Library to manipulate the pile * Description : Library to manipulate the stack
*/ */
#include <stdio.h> #include <stdio.h>
......
/* Author : Dario GENGA /* Author : Dario GENGA
* Date : 16.11.2021 * Date : 23.11.2021
* Description : Library to manipulate the stack * Description : Library to manipulate the stack
*/ */
......
/* Author : Dario GENGA /* Author : Dario GENGA
* Date : 16.11.2021 * Date : 23.11.2021
* Description : Library to manipulate the stack * Description : Library to manipulate the stack
*/ */
#ifndef _PILE_H #ifndef _STACK_H
#define _PILE_H #define _STACK_H
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
typedef struct _stack {
int size;
int top;
int *data;
} stack;
void stack_init(stack *s, int size);
bool stack_is_empty(stack s);
void stack_push(stack *s, int val);
void stack_pop(stack *s, int *val);
void stack_peek(stack s, int *val);
void stack_destroy(stack *s);
#endif #endif
\ No newline at end of file
/* Author : Dario GENGA /* Author : Dario GENGA
* Date : 16.11.2021 * Date : 23.11.2021
* Description : Manipulate matrix * Description : Library to manipulate the stack
*/ */
#include "stack.h" #include "stack.h"
#include <assert.h> #include <assert.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment