domaca_uloha_7
This commit is contained in:
parent
d867e4952f
commit
b0037f417c
@ -27,11 +27,10 @@ struct snake* remove_snake(struct snake* snake){
|
|||||||
struct snake* medzipamat = calloc(1, sizeof(struct snake));
|
struct snake* medzipamat = calloc(1, sizeof(struct snake));
|
||||||
medzipamat = snake;
|
medzipamat = snake;
|
||||||
|
|
||||||
while (1) {
|
while (snake->next->next != NULL) snake = snake->next;
|
||||||
snake = snake->next;
|
|
||||||
if (snake->next->next == NULL) break;
|
|
||||||
}
|
|
||||||
free(snake->next);
|
free(snake->next);
|
||||||
|
|
||||||
snake->next = NULL;
|
snake->next = NULL;
|
||||||
snake = medzipamat;
|
snake = medzipamat;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user