Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lab0 doubly linked list
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mattias Erlingsson
lab0 doubly linked list
Commits
8b423aa3
Commit
8b423aa3
authored
6 years ago
by
Felipe Boeira
Browse files
Options
Downloads
Patches
Plain Diff
Fixed skeleton
parent
c5802b68
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
list.h
+2
-0
2 additions, 0 deletions
list.h
main.c
+62
-0
62 additions, 0 deletions
main.c
with
64 additions
and
0 deletions
list.h
+
2
−
0
View file @
8b423aa3
#ifndef __LIB_KERNEL_LIST_H
#define __LIB_KERNEL_LIST_H
#include
<stdlib.h>
#include
<stdio.h>
/* Doubly linked list.
...
...
This diff is collapsed.
Click to expand it.
main.c
+
62
−
0
View file @
8b423aa3
#include
"list.h"
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
struct
student
{
char
*
name
;
struct
list_elem
elem
;
};
void
insert
(
struct
list
*
student_list
)
{
}
void
delete
(
struct
list
*
student_list
)
{
}
void
list
(
struct
list
*
student_list
)
{
}
void
quit
(
struct
list
*
student_list
)
{
}
int
main
()
{
struct
list
student_list
;
list_init
(
&
student_list
);
int
opt
;
do
{
printf
(
"Menu:
\n
"
);
printf
(
"1 - Insert student
\n
"
);
printf
(
"2 - Delete student
\n
"
);
printf
(
"3 - List students
\n
"
);
printf
(
"4 - Exit
\n
"
);
scanf
(
"%d"
,
&
opt
);
switch
(
opt
)
{
case
1
:
{
insert
(
&
student_list
);
break
;
}
case
2
:
{
delete
(
&
student_list
);
break
;
}
case
3
:
{
list
(
&
student_list
);
break
;
}
case
4
:
{
quit
(
&
student_list
);
break
;
}
default:
{
printf
(
"Quit? (1/0):
\n
"
);
scanf
(
"%d"
,
&
opt
);
if
(
opt
)
quit
(
&
student_list
);
break
;
}
}
}
while
(
1
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment