domaca_uloha_7
This commit is contained in:
parent
ce45e519a5
commit
33861f4a21
@ -16,14 +16,15 @@ struct snake* add_snake(struct snake* snake,int x,int y){
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct snake* remove_snake(struct snake* snake){
|
struct snake* remove_snake(struct snake* snake){
|
||||||
struct snake* nasledujuci = snake->next;
|
struct snake* nasledujuci = calloc(1, sizeof(struct snake));
|
||||||
|
nasledujuci = snake->next;
|
||||||
free(snake);
|
free(snake);
|
||||||
|
|
||||||
return nasledujuci;
|
return nasledujuci;
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_snake(struct snake* sn){
|
void free_snake(struct snake* sn){
|
||||||
struct snake* nasledujuci;
|
struct snake* nasledujuci = calloc(1, sizeof(struct snake));
|
||||||
|
|
||||||
while (sn != NULL) {
|
while (sn != NULL) {
|
||||||
nasledujuci = sn->next;
|
nasledujuci = sn->next;
|
||||||
|
Loading…
Reference in New Issue
Block a user