Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
William Sha
ai01_tp1
Commits
3a78ab6a
Commit
3a78ab6a
authored
Nov 14, 2017
by
Unknown
Browse files
Auto stash before merge of "master" and "origin/master"
parent
130bc8f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/Debug/tp1
0 → 100755
View file @
3a78ab6a
File added
tp3.c
View file @
3a78ab6a
...
...
@@ -26,7 +26,12 @@ void insert_empty_list(List* list, char* str){
}
Element
*
e
=
malloc
(
sizeof
(
Element
));
strncpy
(
e
->
data
,
str
,
N
);
char
tmp
[
N
];
strncpy
(
tmp
,
str
,
N
);
e
->
data
=
tmp
;
e
->
next
=
NULL
;
list
->
head
=
e
;
list
->
tail
=
e
;
...
...
@@ -45,9 +50,11 @@ void insert_beginning_list(List* list, char* str){
}
Element
*
e
=
malloc
(
sizeof
(
Element
));
if
(
DEBUG
)
printf
(
"Trying to put input into a new element...
\n
"
,
list
,
str
);
strncpy
(
e
->
data
,
str
,
N
)
;
if
(
DEBUG
)
printf
(
"Trying to put input into a new element...
\n
"
);
char
tmp
[
N
]
;
strncpy
(
tmp
,
str
,
N
);
e
->
data
=
tmp
;
// changes the chain to plug the new element
if
(
DEBUG
)
printf
(
"Reorganizing the list...
\n
"
,
list
,
str
);
...
...
Write
Preview
Supports
Markdown
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