1
I am with this function to remove at the beginning, it happens that when I insert numbers as for example: 1 2 3, and then call the function to remove at the beginning and delete the number 2, while the correct one was to delete the number 1, because it is the beginning of the list. Already try everything here, up to my limit and I could not.
int retira_no_inicio (tipo_lista *p)
{
tipo_lista * aux;
//tipo_lista * ant;
if (p -> prox == NULL)
{
return NULL;
}
aux = p -> prox;
p -> prox = aux -> prox;
return p;
}
According to the last questions you asked here in the community, which are ALL related to the same problem, I strongly recommend you go back to basics and study the concepts again. If it was really you who made these codes, you shouldn’t have so many difficulties in designing these functions. Take your books again and review your codes. It will be much more profitable for you.
– Woss
It’s not really my codes, I’m studying this in college and I don’t have any experience, I’m at the beginning of the semester, I’m having some free time and I want to test to see if you’re certain those functions that were passed on, some I got to test and some I ask for help in the forum, I only ask for help after trying several times. But very grateful for the tip.
– André
If you have free time, forget the codes ready and try to do them yourself.
– Woss
I have a lot of difficulty programming, but this explanation your there was excellent saw, I’m doing table test and I understood right.
– André
I made a function remove_no_fim with type int and it worked.
– André