May 6, 2021 at 3:28am UTC
I rechecked it and fixed two of the errors now it is just an error on line 82 the initiating the module.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
#include<iostream>
#include<cstdlib>
using namespace std;
struct node
{
int list;
struct node *next;
struct node *prev;
}*start;
class dyn_list
{
public :
void list_creation(int value);
void add_first(int value);
void add_next(int value, int position);
void delete_integer(int value);
void search(int value);
void display_list();
void count();
void reverse();
dyn_list()
{
start = NULL;
}
};
void list_creation(int value)
{
struct node *s, *temp;
temp=new (struct node);
temp-> list= value;
temp-> next = NULL;
if (start == NULL)
{
temp-> prev= NULL;
start = temp;
}
else
{
s = start;
while (s-> next != NULL)
s= s->next;
s-> next= temp;
temp ->prev =s;
}
}
int main()
{
int values, number, options;
cout<<"This is my Doubly Linked List; Are you ready? Options are 1= Yes & 2= No." << endl;
cin >> values;
if (options == 1)
{
cout <<"Alright lets get started with the list for this project! Please enter the values:" << endl;
cin >> number;
dyn_list.list_creation(values);
cout<<endl;
}
else if (options == 2)
{
return 0;
}
}
Last edited on May 6, 2021 at 4:43am UTC
May 6, 2021 at 4:29am UTC
I apologize salem also I found two of the errors to be structure errors and fixed them just have one last one I still work on it.