Questions tagged as 'lista-encadeada'

1
answer

How to use free in a structure variable (chained list)?

I can not use free() in " struct Lista *proximo ". Here is my code: #include "stdafx.h" #include <stdlib.h> #include <conio.h> #include <locale.h> struct Lista { int num; struct Lista *proximo; }celula;...
asked by 23.01.2018 / 17:46
1
answer

Struct address for INT

I have the following Struct: struct nodo{ int elo_a; char nick[26]; char cidade[16]; int idade; int elo_p;}; I have two struct assignments: struct nodo *variavel; struct nodo *offline; Okay, I already inserted a value in offline, sett...
asked by 07.11.2017 / 01:34
2
answers

Inserting elements into a dynamic list

I did this function, but I do not know if it's right, it does not give the compilation error, but it gives an error when prompt appears that the program stopped working. Insertion at startup: int inserir_no_inicio_da_lista (Lista* li...
asked by 04.10.2017 / 14:37
1
answer

Double-chained Circular List in C / C ++

I'm having trouble removing the first and last elements of this circular list. // Created by Thiago Cunha on 25/05/2017. // #include "double_linked_list_circular.h" int count = 0; List* init() { return NULL; } List* insertInit(List* li...
asked by 30.05.2017 / 15:24
1
answer

Trash memory output function inserts in the middle of a list

Staff developed this function: tipo_lista * insere_meio(tipo_lista *aux, tipo_lista * valor, int pos){ int cont=1; //é a posição do primeiro elemento da lista encadeada tipo_lista * p = aux; tipo_lista * novo = (tipo_lista*)malloc(sizeof(ti...
asked by 25.05.2017 / 21:45
2
answers

Problem deleting list with recursion

I'm trying to use this function to remove it from the list, but it runs infinitely. void rDeleta(lista* l, int elemento) { if(l!= NULL) { if(l->elem == elemento) { lista* aux = l; l = l->prox;...
asked by 06.12.2016 / 20:26
1
answer

Function return type for a linked list

What kind of return to use in a threaded list? For example, enter at the top of the list. void inserir(pessoas **pessoa, int valor) No return (% with%). Or return a pointer from the list. pessoas* inserir(pessoas **pessoa, int valor)...
asked by 07.12.2016 / 15:29
1
answer

Doubt - Dynamic List

I have the following structure for my dynamic list: typedef struct DataNode { int id; } DataNode; typedef struct Node { DataNode data; struct Node *Next; } Node; typedef struct List { int size; Node *head; } Li...
asked by 11.12.2018 / 02:04
1
answer

Saving a linked list

Hello, I have some doubts that I will illustrate below: Having two doubly-linked lists A and B with the structure struct lista { Ponto* dado; /* dado = número */ struct lista *prox; /* ponteiro para o proximo element...
asked by 10.07.2018 / 19:30
0
answers

Problems deleting certain element from a list within another linked list

I'm having a problem removing an element, I have a function that is responsible for deleting the element within doubly chained lists. How does it work? In the main function is called the name of an element (movie) in which to remove. T...
asked by 01.07.2018 / 18:41