我知道这对我的第一个问题来说是一个很长的问题,但我已经真的试图在2周内解决这个问题而无济于事.
我很确定我的问题是与记忆相关的问题,即使我已经搜索了其他人的解决方案,我也没有运气.
这是代码:
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
using namespace std;
typedef string tElemLista;
typedef struct nodo {
tElemLista title;
tElemLista info; // el elemento en sí
nodo *next; // puntero autoreferencial
nodo *prev;
// al proximo nodo
} tNodo;
class tLista {
tNodo *head;
tNodo *tail;
tNodo *curr;
unsigned int listSize;
unsigned int pos; // posición actual en la lista
public:
tLista() {
head = tail = curr = NULL;
listSize = 0; // lista vacía …Run Code Online (Sandbox Code Playgroud)