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
482aad3f
Commit
482aad3f
authored
Nov 20, 2017
by
William Sha
Browse files
Removed comments for remove
parent
5282aaec
Changes
1
Hide whitespace changes
Inline
Side-by-side
tp3.c
View file @
482aad3f
...
...
@@ -110,7 +110,7 @@ int remove_element(List* list, int p){
printf
(
"List pointer is null.
\n
"
);
return
-
1
;
}
/*
if
(
p
<=
0
){
printf
(
"The provided value for the position is incorrect.
\n
"
);
return
-
1
;
...
...
@@ -126,7 +126,7 @@ int remove_element(List* list, int p){
e sera utilisé pour pointer la bonne position, suppr sera utilisé pour "manger le nombre" (désallocation)
e will be used to focus on the right place, suppr will be used to "eat the number"
*/
/*
while
(
n
<
p
){
// tant que l'on est pas arrivé au Pème chiffre
if
(
DEBUG
)
printf
(
"WHILE
\n
"
);
do
{
...
...
@@ -134,8 +134,15 @@ int remove_element(List* list, int p){
}
while
(
e
->
data
!=
NULL
);
// on parcoure la liste jusqu'au prochain nombre
suppr
=
e
->
next
;
n
++
;
}*/
/*
}
/* à ce niveau, on en est là :
P
| ##### | ##### | ¤¤¤¤¤ | ##### | ##### | ¤¤¤¤¤ |
^ ^
e suppr
*/
do
{
if
(
DEBUG
)
printf
(
"DO2
\n
"
);
e
->
next
=
suppr
->
next
;
...
...
@@ -156,8 +163,8 @@ int remove_element(List* list, int p){
free
(
suppr
);
}
return 0;
*/
}
return
0
;
}
int
compare
(
char
*
str1
,
char
*
str2
){
if
(
DEBUG
)
printf
(
"COMPARE
\n
"
);
...
...
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