Posts by Arthur • 45 points
4 posts
-
1
votes1
answer367
viewsA: How to remove the smallest element in a dynamic/chained C list (TAD)
I got !! int menor_elem(Lista *lst){ if (lista_vazia(*lst) == 1) return 0; Lista aux = *lst; int x; x = aux->info; while (aux->prox != NULL){ if (aux->info < x) x = aux->info; aux =…
-
1
votes1
answer367
viewsQ: How to remove the smallest element in a dynamic/chained C list (TAD)
"Create an unordered list TAD by implementing the minor function (removes the smallest element from a list) dynamic/chained". int menor_elem(Lista *lst){ Lista aux = *lst; if (lista_vazia(*lst) ==…
-
1
votes1
answer703
viewsQ: I can’t dynamically allocate a struct vector in C
I don’t know why you can’t allocate!! struct dados { int numero; char nome[5]; }; typedef struct dados Das; void manipula_um_par (struct dados *a, int b) { a[b].numero = a[b].numero /2; } void…
-
1
votes1
answer228
viewsQ: I don’t know why my program doesn’t work!! EM C
In the exercise I need to create a struct and send it to the function that checks if the number is even, if yes it sends to another function that returns the number /2. #include <stdio.h>…