Need help

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
https://www.cplusplus.com/articles/jEywvCM9/
After 20 posts, you should have figured this out.

And
"I got three errors pertaining to the first module which is list_creation module for some reason. "
Sure, posting them would be a good move on your part.

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.
Paste the actual text of the error message.
 In function 'int main()':
82:9: error: expected unqualified-id before '.' token
 

dyn_list is a type, not a variable.

1
2
3
4
dyn_list my_awesome_list;
...

my_awesome_list.list_creation(values);



> void list_creation(int value)
This needs the class name if you want it to be part of the class.


Your indentation is lousy as well.
Topic archived. No new replies allowed.