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
3d75117f
Commit
3d75117f
authored
Sep 22, 2020
by
Liam E. Roeth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned up \n's in main.c
parent
69c441bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
main.c
main.c
+5
-4
No files found.
main.c
View file @
3d75117f
...
@@ -8,7 +8,7 @@ void panic(){
...
@@ -8,7 +8,7 @@ void panic(){
int
menu
(
struct
Node
*
head
){
int
menu
(
struct
Node
*
head
){
int
choice
,
input
,
index
,
value
;
int
choice
,
input
,
index
,
value
;
puts
(
"Welcome to the menu for creation of linked lists."
);
puts
(
"
\n
Welcome to the menu for creation of linked lists."
);
puts
(
"Displaying possible actions:"
);
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;"
);
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;"
);
fputs
(
"Please input the number of your desired action: "
,
stdout
);
fputs
(
"Please input the number of your desired action: "
,
stdout
);
...
@@ -16,16 +16,17 @@ int menu(struct Node *head){
...
@@ -16,16 +16,17 @@ int menu(struct Node *head){
switch
(
choice
)
switch
(
choice
)
{
{
case
1
:
//append
case
1
:
//append
fputs
(
"You have decided to insert a value at the end. Input the desired value now:
\n
"
,
stdout
);
fputs
(
"You have decided to insert a value at the end. Input the desired value now: "
,
stdout
);
scanf
(
"%d"
,
&
value
);
scanf
(
"%d"
,
&
value
);
add_to_end
(
head
,
value
);
add_to_end
(
head
,
value
);
break
;
break
;
case
2
:
//delete node
case
2
:
//delete node
// break;
panic
();
break
;
case
3
:
//insert
case
3
:
//insert
fputs
(
"You have decided to insert a value at a specific point. Input the node index now: "
,
stdout
);
fputs
(
"You have decided to insert a value at a specific point. Input the node index now: "
,
stdout
);
scanf
(
"%d"
,
&
index
);
scanf
(
"%d"
,
&
index
);
fputs
(
"
\n
Please input the value now: "
,
stdout
);
fputs
(
"Please input the value now: "
,
stdout
);
scanf
(
"%d"
,
&
value
);
scanf
(
"%d"
,
&
value
);
insert_node
(
head
,
index
,
value
);
insert_node
(
head
,
index
,
value
);
break
;
break
;
...
...
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