Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
algorithmique
lib_2021_malaspinas
stack
Compare revisions
3218190932b3ae5d1b0955c0601c9a76fc817cfb to 6aab0548c81d2b8d1186a85ed5a50aa686497fa0
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
algorithmique/lib_2021_malaspinas/stack
Select target project
No results found
6aab0548c81d2b8d1186a85ed5a50aa686497fa0
Select Git revision
Branches
3-add-makefile-with-structure
4-add-create-init-function
5-add-push-function-2
9-add-destroy-function-2
9-add-destroy-function-3
9-add-destroy-function-4
main
Tags
v0.1
8 results
Swap
Target
algorithmique/lib_2021_malaspinas/stack
Select target project
algorithmique/lib_2021_malaspinas/stack
1 result
3218190932b3ae5d1b0955c0601c9a76fc817cfb
Select Git revision
Branches
3-add-makefile-with-structure
4-add-create-init-function
5-add-push-function-2
9-add-destroy-function-2
9-add-destroy-function-3
9-add-destroy-function-4
main
Tags
v0.1
8 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
* Added `stack_init()` function
· 93cf8510
alec.schmidt
authored
3 years ago
and
orestis.malaspin
committed
3 years ago
* Added `DEFAULT_CAPACITY` constant
93cf8510
Merge branch 'stack_init' into 'main'
· 6aab0548
orestis.malaspin
authored
3 years ago
Added init function See merge request
!8
6aab0548
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
stack.c
+12
-0
12 additions, 0 deletions
stack.c
stack.h
+2
-0
2 additions, 0 deletions
stack.h
with
14 additions
and
0 deletions
stack.c
View file @
6aab0548
#include
"stack.h"
#include
"stack.h"
#include
<assert.h>
#include
<stdio.h>
#include
<stdlib.h>
#define DEFAULT_CAPACITY 4
void
stack_init
(
stack
*
s
)
{
s
->
top
=
-
1
;
s
->
capacity
=
DEFAULT_CAPACITY
;
s
->
data
=
malloc
(
sizeof
(
int
)
*
DEFAULT_CAPACITY
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
stack.h
View file @
6aab0548
...
@@ -7,4 +7,6 @@ typedef struct _stack {
...
@@ -7,4 +7,6 @@ typedef struct _stack {
int
top
;
int
top
;
}
stack
;
}
stack
;
void
stack_init
(
stack
*
stack
);
#endif
#endif
This diff is collapsed.
Click to expand it.