Linked List using only structs

I am trying to make a linked list using only structs. Thing is, I'm really bad at programming. And therefore I make ALOT of mistakes. If anyone has the patience to go through this and point out the mistakes and how to correct them, please do. I need to do this by morning :/
Plus the code isn't complete I'm still trying to get the AddNodes part working.
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

/* The menu options are defined here */
#define ADD		1        
#define DELETE	2     
#define MODIFY	3
#define SEARCH	4
#define DISPLAY	5
#define EXIT      6  // if you add some thing after this make sure to modify the condition 
                     // of the do while loop.


/************************************/
/* The constant fileds */
const int LEN_NAME =10;
const int LEN_EMAIL =20;
const int LEN_TELNO =15;

/*Enumerated types for the status of the students  */

enum StatusT {REGISTERED, ENROLLED, GRADUATED, CLOSED, DROPEDOUT };

// This Corresponds to above enum to convert the values into string

char *StatusStr[] = {"Registered", "Enrolled", "Graduated", "Closed", "Dropedout"};

/* The declaration of the student recrod type node. You can declare
 * as many variable of this type as you like. Each one of them is 
 * going to have the same fields/atributes but of their own.
 */

struct NodeT {    
	int  RollNo;
	char Name[LEN_NAME];
 	char Section;
	char Email[LEN_EMAIL];
	char TelNo[LEN_TELNO];
	StatusT Status;
    
    NodeT *Next;
};

/* This is a global variable 
 * Should always points to the first node of list
 */

NodeT *Head = NULL;   

/* Prototypes of the functions used in the C++ program file. 
 * If you add a new function in your program do not forget to 
 * put its prototype here. Any prototype declaration in the program file
 * will heart your grade.
 */

void AddNewNode();  
void AddFirstNode(NodeT*);
void AddLastNode(NodeT*);           
void DeleteNode();
void ModifyNode(); 
void DisplayNode(NodeT*);
void DisplayCompleteList(); 
bool AddMiddleNode(NodeT*);

NodeT *GetNewNode();
NodeT *SearchNode();


/***************************** MAIN **************************************/
int main(){
	int choice;

	while(1){
		do {

			cout << "\n\n\n\n\n";  
			cout << "============================"	<< endl;
			cout << "         MAIN  MENU         "	<< endl;
            cout << "============================"  << endl;
			cout << "    "<< ADD    <<": Add a new record"	<< endl; 
			cout << "    "<< DELETE <<": Delete a record"	<< endl;
			cout << "    "<< MODIFY <<": Modify a record"	<< endl;
			cout << "    "<< SEARCH <<": Search a record"	<< endl;
			cout << "    "<< DISPLAY<<": Display"			<< endl;
			cout << "    "<< EXIT   <<": Exit"				<< endl;
			cout << "============================"			<< endl;	
			cout << "       Your choice :";
			cin  >>  choice;
		} while ((choice < ADD) || (choice > EXIT)); 
                                                  
		switch (choice){
		  case ADD    : if(Head = NULL)
							GetNewNode();
						else
							AddNewNode();
			  /* Check if it is very first node */ 
		  		        /* If yes creat and add           */
                        /* if no then call AddNewNode()   */
		  		    break;                    
		  
		  case DELETE : /* Call the Appropriate functions */
				    break;
		  case MODIFY : /* Call the appropriate functions */
		  		    break;
		  case SEARCH : /* Search and dispalay the record of a student */
		  		    break;
		  case DISPLAY: /* shoudl display the complete list */ 
                           break;
		  
          case EXIT   : cout<<"Thankyou for using this program...Good day:"<<endl;
						system("pause");
			            return 0;
		} // switch(choice)
	} // while(1)
	system("pause");
} //main()


/*********************************** GetNewNode()***********************************/
NodeT *GetNewNode(){
	NodeT *NewNode = NULL;
	NewNode = new NodeT;
	NewNode->Next = NULL;
	NewNode->Name;
	NewNode->RollNo;
	NewNode->Email;
	NewNode->Section;
	NewNode->TelNo;
	NewNode->Status;
/* You must allocate memory on the heap for the new node
 * Set different fields by getting input from the user
 * Return the pointer of this node to the calling function
 * 
 * i.e. this function must do step I and step II
 */

return NULL;
}

/*********************************** AddNewNode()***********************************/
void AddNewNode(){
	NodeT *NewNode;
	NodeT *Current;
	Current = Head;
	if(NewNode->RollNo < Head->RollNo)
		AddFirstNode(NewNode);

	else if(NewNode->Next= NULL)
		AddLastNode(NewNode);

	else{
		while ((Current->Next != NULL ) && (Current->Next->RollNo < NewNode->RollNo)) {
		Current= Current->Next;
		AddMiddleNode(NewNode);
		}
	}
/* Do the required declarations
 *	
 *
 * Make sure step I and step II have been done
 *
 *
 * Now check the first possibility: i.e. adding in the front of list.
 * else check for second possibility: i.e adding at the end of list.
 * else it is to be added in the middle. 
 * 
 */ 
}

/************************************ AddFirstNode() **************************************/
void AddFirstNode(NodeT *NewNode){
	NewNode->Next = Head;
	Head = NewNode;
	NewNode = NULL;

}

/***************************** AddMiddleNode() *********************************/
bool AddMiddleNode(NodeT *NewNode){ 
	NodeT *Current;
	Current = Head;

	NewNode->Next = Current->Next;
	Current->Next = NewNode;
	NewNode = Current = NULL;

 return true; // This is a dumy statement to resolve the compiler error
}

/********************************* AddLastNode()******************************************/
void AddLastNode(NodeT *NewNode){           
	NodeT *Current;
	Current->Next = NewNode;
	NewNode = NULL;

}

/********************************* DeleteNode()******************************************/
void DeleteNode(){
/*
 *  Ask the user which node s/he wants to delete
 *  search the required node in the list
 *  if the node is found then remove it form the list
 *    free the memory reserved for the node by using delete operator.
 *
 *  Make sure to handel differnt possibilites that may arrise due to 
 *  deletion of the node. 
 *
 */

}

/*************************************** ModifyNode() ***********************************/
void ModifyNode(){
/*
 *
 *
 *
 *
 *
 *
 */

}

/*********************************** SearchNode()***************************************/
NodeT *SearchNode(){
/*
 *  Write the code to search a node in the list.
 *  if it is found 
 *     return its pointer
 *  if not found  
 *     return null
 *
 */
  return NULL; // Very dangerous. Just to remove the compiler error
}

/******************************* DisplayNode() *******************************************/
void DisplayNode(NodeT *Record){  
	cout << endl;
	cout << "Name	  : " << Record->Name	 << endl;
	cout << "Roll no  : " << Record->RollNo	 << endl;
	cout << "Section  : " << Record->Section << endl;
	cout << "Email	  : " << Record->Email	 << endl;
	cout << "Telephone #: " << Record->TelNo << endl;
//	cout << "Status	  : " << ; // do it your self 

}


/******************************* DisplayCompleteList()***********************************/
void DisplayCompleteList(){ 
	NodeT *Current;
	Current = Head;
	while(Current!=NULL){
		DisplayNode(Current);
		Current=Current->Next;
	}
	if(Current==NULL){
		cout << "List is empty" << endl;  
	}
}


Sorry for the long code. Any help would be appreciated
Topic archived. No new replies allowed.