Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
linked_list2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Liam E. Roeth
linked_list2
Commits
0d424f97
Commit
0d424f97
authored
Sep 22, 2020
by
h702579998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the functionality for the functionality of the insertatindex function in main.c
parent
f58ba3a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
main.c
main.c
+6
-2
No files found.
main.c
View file @
0d424f97
...
...
@@ -7,7 +7,7 @@ void panic(){
}
int
menu
(
struct
Node
*
head
){
int
choice
,
input
;
int
choice
,
input
,
index
,
value
;
puts
(
"Welcome to the menu for creation of linked lists."
);
puts
(
"Displaying possible actions:"
);
puts
(
"1. Add at End;
\n
2. Delete Node;
\n
3. Insert Node;
\n
4. Search for value;
\n
5. Print a node;
\n
6. Print full list;
\n
7. Delete list and exit;"
);
...
...
@@ -20,7 +20,11 @@ int menu(struct Node *head){
case
2
:
//delete node
// break;
case
3
:
//insert
panic
();
fputs
(
"You have decided to insert a value at a specific point. Input the node index now: "
,
stdout
);
scanf
(
"%d"
,
&
index
);
fputs
(
"
\n
Please input the value now: "
,
stdout
);
scanf
(
"%d"
,
&
value
);
insert_node
(
head
,
index
,
value
);
break
;
case
4
:
//search
fputs
(
"You have selected to search for a value. Please input the value now: "
,
stdout
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment