doesn't work

Hey, i'm working on a project for school. I don't know what to do with this error:
'Debug Assertion Failed!

Program

File: F:\dd\vctools\crt_bld\self_x86\crt\src\feoferr.c
Line: 44

Expression: (stream !=Null)'

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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <iostream>

using namespace std;

struct  Jucatori
{
	int *serie;
	char *Agent_Jucator;
	char *Nume_Jucator ;
	char *Pozitie_Jucator;
	char *Varsta_Jucator ;
	char *Valoare_Jucator;
	float *Pret;
};


struct Nod
{
	Jucatori juc;
	Nod *st,*dr;
};


struct Lista_liste
{
	Nod* inf;
	Lista_liste* adr;
	char* tipul;
};


void InserareSfarsit(Nod **prim, Jucatori player)
{
	Nod *nou= new Nod;
	nou->juc = player;
	nou->dr = NULL;
	nou->st = NULL;

	if (*prim == NULL)
		*prim = nou;
	else
	{
		Nod *aux = *prim;
		while (aux->dr != NULL)
			aux = aux->dr;

		aux->dr = nou;
		nou->st = aux;
	}

}

void InserareArbore (Nod **r, Nod * n){
	Nod *p, *pr; 
	p = *r;
	pr = p;
	int k = 0;
	while (p!=NULL){
		pr = p;
		if (*p->juc.serie == *n->juc.serie)
			return;
		else if (*p->juc.serie > *n->juc.serie){
			p = p->st;
			k = -1;
		}
		else {
			p = p->dr;
			k = 1;
		}
	}
	if (k == -1)
		pr->st = n;
	else if (k == 1)
		pr->dr = n;	
}

void Conversie(Nod **lista){
	Nod *p, *q;
	p = (*lista)->dr;
	(*lista)->dr = NULL;
	(*lista)->st = NULL;
	while (p != NULL){
		q = p->dr; 
		p->dr = NULL;
		p->st =NULL;
		InserareArbore(lista,p); 
		p = q;

	}
}

void Afisare_fisier(FILE *f2,Nod* r)
{
	if (f2)
		fprintf(f2,"%d %s %s %s %s %d%s %d%s %s %s %.2f \n",
		*r->juc.serie,
		r->juc.Agent_Jucator,
		r->juc.Nume_Jucator,
		r->juc.Pozitie_Jucator,
		r->juc.Varsta_Jucator,
		*r->juc.Valoare_Jucator,
		*r->juc.Pret);
}  

void inordine(FILE *f2,Nod* r)
{ 
	if(r != NULL)
	{
		//prelucrare nod
		if (f2) {
			inordine(f2,r->st);
			fprintf(f2,"%d %s %s %s %s %d%s %d%s %s %s %.2f \n",
				*r-> juc.serie,
				r->juc.Agent_Jucator,
				r->juc.Nume_Jucator,
				r->juc.Pozitie_Jucator,
				r->juc.Varsta_Jucator,
				*r->juc.Valoare_Jucator,
				*r->juc.Pret);
			/*Afisare_fisier(f2,r);*/
			inordine(f2,r->dr); }
	}

}

void cauta(Nod* rad,int marime,float pret2,FILE *f2)
{
	if (rad)
	{
		if ((*rad->juc.Valoare_Jucator>=marime) && (*rad->juc.Pret<=pret2)) Afisare_fisier(f2,rad);
		cauta(rad->st,marime,pret2,f2);
		cauta(rad->dr,marime,pret2,f2);
	}
}

void creare_Lista_liste(Lista_liste** c,Nod* rad)
{
	if(rad)
	{

		creare_Lista_liste(c,rad->st);
		Lista_liste *p=*c ,*prec;
		prec = NULL;
		while (p!=NULL && strcmp(p->tipul,rad->juc.Agent_Jucator)!=0)
		{ 
			prec = p;
			p=p->adr;
		}

		if (p && strcmp(p->tipul,rad->juc.Agent_Jucator)==0)
		{
			Jucatori q;
			q.Valoare_Jucator=new char[strlen(rad->juc.Valoare_Jucator)+1];
			strcpy(q.Valoare_Jucator,rad->juc.Valoare_Jucator);

			q.Varsta_Jucator=new char[strlen(rad->juc.Varsta_Jucator)+1];
			strcpy(q. Varsta_Jucator,rad->juc.Varsta_Jucator);

			q.Pret=new float;    *q.Pret=*rad->juc.Pret;

			q.serie=new int; *q.serie=*rad->juc.serie;

			q.Nume_Jucator=new char[strlen(rad->juc.Nume_Jucator)+1];
			strcpy(q. Nume_Jucator,rad->juc.Nume_Jucator);

			q.Pozitie_Jucator=new char[strlen(rad->juc. Pozitie_Jucator)+1];
			strcpy(q. Pozitie_Jucator,rad->juc.Pozitie_Jucator);

			q.Agent_Jucator=new char[strlen(rad->juc. Agent_Jucator)+1];
			strcpy(q.Agent_Jucator,rad->juc.Agent_Jucator);

			InserareSfarsit(&p->inf, q);
		}


		/*		else
		{
		Lista_liste* nou;
		nou=new Lista_liste;
		nou->tipul=rad->juc.Agent_Jucator;
		nou->adr=NULL;
		nou->inf = new Nod;
		nou->inf->juc.Valoare_Jucator=new char[strlen(rad->juc.Valoare_Jucator)+1];
		strcpy(nou->inf->juc.Valoare_Jucator,rad->juc.Valoare_Jucator);
		nou->inf->juc.Agent_Jucator =new char[strlen(rad->juc.Agent_Jucator)+1];
		strcpy(nou->inf->juc.Agent_Jucator,rad->juc.Agent_Jucator);

		nou->inf->juc.Valoare_Jucator=new char[strlen(rad->juc.Valoare_Jucator)+1];
		strcpy(q.Valoare_Jucator,rad->juc.Valoare_Jucator);

		nou->inf->juc.Pret=new float;    *nou->inf->juc.Pret=*rad->juc.Pret;
		nou->inf->juc.serie=new int;		*nou->inf->juc.serie=*rad->juc.serie;

		nou->inf->juc.Varsta_Jucator=new char[strlen(rad->juc.Varsta_Jucator)+1];
		strcpy(q. Varsta_Jucator,rad->juc.Varsta_Jucator);

		nou->inf->juc.Nume_Jucator=new char[strlen(rad->juc.Nume_Jucator)+1];
		strcpy(q. Nume_Jucator,rad->juc.Nume_Jucator);

		nou->inf->juc.Pozitie_Jucator=new char[strlen(rad->juc. Pozitie_Jucator)+1];
		strcpy(q. Pozitie_Jucator,rad->juc.Pozitie_Jucator);

		nou->inf->juc.Agent_Jucator=new char[strlen(rad->juc.Agent_Jucator)+1];
		strcpy(nou->inf->juc.Agent_Jucator,rad->juc.Agent_Jucator);

		nou->inf->dr = NULL;
		nou->inf->st = NULL;
		if (prec == NULL)
		*c = nou;
		else 
		prec->adr = nou;
		} */

		else
		{
			Lista_liste* nou;
			nou=new Lista_liste;
			nou->tipul=rad->juc.Agent_Jucator;
			nou->adr=NULL;
			nou->inf = new Nod;
			nou->inf->juc.Valoare_Jucator=new char[strlen(rad->juc.Valoare_Jucator)+1];
			strcpy(nou->inf->juc.Valoare_Jucator,rad->juc.Valoare_Jucator);
			nou->inf->juc.Agent_Jucator =new char[strlen(rad->juc.Agent_Jucator)+1];
			strcpy(nou->inf->juc.Agent_Jucator,rad->juc.Agent_Jucator);

			nou->inf->juc.Valoare_Jucator=new char[strlen(rad->juc.Valoare_Jucator)+1];
			strcpy(nou->inf->juc.Valoare_Jucator,rad->juc.Valoare_Jucator);

			nou->inf->juc.Pret=new float;    *nou->inf->juc.Pret=*rad->juc.Pret;
			nou->inf->juc.serie=new int;		*nou->inf->juc.serie=*rad->juc.serie;

			nou->inf->juc.Varsta_Jucator=new char[strlen(rad->juc.Varsta_Jucator)+1];
			strcpy(nou->inf->juc.Varsta_Jucator,rad->juc.Varsta_Jucator);

			nou->inf->juc.Nume_Jucator=new char[strlen(rad->juc.Nume_Jucator)+1];
			strcpy(nou->inf->juc.Nume_Jucator,rad->juc.Nume_Jucator);

			nou->inf->juc.Pozitie_Jucator=new char[strlen(rad->juc. Pozitie_Jucator)+1];
			strcpy(nou->inf->juc.Pozitie_Jucator,rad->juc.Pozitie_Jucator);

			nou->inf->juc.Agent_Jucator=new char[strlen(rad->juc.Agent_Jucator)+1];
			strcpy(nou->inf->juc.Agent_Jucator,rad->juc.Agent_Jucator);

			nou->inf->dr = NULL;
			nou->inf->st = NULL;
			if (prec == NULL)
				*c = nou;
			else 
				prec->adr = nou;
		} 

		creare_Lista_liste(c,rad->dr);
	}
}

void afisare_Lista_liste(Lista_liste *L)
{
	FILE *f3;
	Nod *p;
	if (f3=fopen("Listadeliste.txt","w"))
		while (L)
		{
			fprintf(f3,"\n  Agent_Jucator: %s",L->tipul);
			fprintf(stdout,"\nAgent_Jucator : ",L->tipul);
			cout<<L->tipul;
			p = L->inf;
			while (p!=NULL)
			{

				fprintf(f3,"\n\t %d %s %s %s %d%s %d%s %s %s %.2f \n",
					*p->juc.serie,
					p->juc.Nume_Jucator,
					p->juc.Pozitie_Jucator,
					p->juc.Varsta_Jucator,
					*p->juc.Valoare_Jucator,
					*p->juc.Pret);

				fprintf(stdout,"\n\t %d %s %s %s %d%s %d%s %s %s %.2f \n",
					*p-> juc.serie,
					p->juc.Nume_Jucator,
					p->juc.Pozitie_Jucator,
					p->juc.Varsta_Jucator,
					*p->juc.Valoare_Jucator,
					*p->juc.Pret);
				p=p->dr;
			}
			L=L->adr;
		}
		fclose(f3);
}

Nod* sterge(Nod* rad,int X,int* er)
{
	Nod* p, *q;
	*er=0;
	if(rad==NULL) *er=1;
	else if(*rad->juc.serie > X) rad->st=sterge(rad->st,X,er);
	else if(*rad->juc.serie < X) rad->dr=sterge(rad->dr,X,er);
	else if(rad->st==NULL)
	{ 
		p=rad;
		rad=rad->dr;
		delete[] p->juc.Agent_Jucator ;
		delete[] p->juc.Nume_Jucator;
		delete[] p->juc.Pozitie_Jucator;
		delete[] p->juc.Varsta_Jucator;
		delete[] p->juc.Valoare_Jucator;
		delete p->juc.serie;
		delete p->juc.Pret ; 
		delete p;
	}
	else 
		if(rad->dr==NULL)
		{
			p=rad;
			rad=rad->st;
			delete[] p->juc.Agent_Jucator ;
			delete[] p->juc.Nume_Jucator;
			delete[] p->juc.Pozitie_Jucator;
			delete[] p->juc.Varsta_Jucator;
			delete[] p->juc.Valoare_Jucator;
			delete p->juc.serie;
			delete p->juc.Pret;

			delete p;
		}
		else{
			p=rad->st;
			q=rad;
			while(p->dr!=NULL)
			{
				q=p;
				p=p->dr;
			}

			rad->juc=p->juc;
			if(q==rad)
				rad->st=p->st;
			else
				q->dr=p->st;
			delete p;
		}

		return rad;
}
Nod* stergearbore(Nod *rad)
{
	if(rad)
	{   
		int er;
		rad=sterge(rad,*rad->juc.serie,&er);
		rad=stergearbore(rad);

	}
	return rad;
}


what should i do? help please
Did you post the correct file? Line 44 is an else statement, and there is no assert statement and no variable named stream.
yeah, so i do not know what to do. somehow know any solution? please
but there is no main function so it cannot be the whole program!
I removed from him because it was over 9000 characters.
this is the rest of the program:
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
Nod* StergereSf(Nod *p)
{
	if (p)
	{
		if (p->dr)
		{
			Nod *aux=p;
			while (aux->dr->dr) aux=aux->dr;
			delete[] aux->dr->juc.Agent_Jucator;
			delete[] aux->dr->juc.Nume_Jucator;
			delete[] aux->dr->juc.Pozitie_Jucator;
			delete[] aux->dr->juc.Varsta_Jucator;
			delete[] aux->dr->juc.Valoare_Jucator;
			delete aux->dr->juc.serie;
			delete aux->dr->juc.Pret;
			delete aux->dr;
			aux->dr=NULL;
		}
		/*		else{
		delete[] aux->dr->juc.Agent_Jucator;
		delete[] aux->dr->juc.Nume_Jucator;
		delete[] aux->dr->juc.Pozitie_Jucator;
		delete[] aux->dr->juc.Varsta_Jucator;
		delete[] aux->dr->juc.Valoare_Jucator;
		delete p->juc.serie;
		delete p->juc.Pret;

		delete p;
		p=NULL;
		} */
	}
	return p;
}

Lista_liste* Stergere(Lista_liste *p)
{
	if (p)
	{
		if (p->adr)
		{ 
			Lista_liste *aux=p;
			while (aux->adr->adr) aux=aux->adr;
			while (aux->adr->inf)
				aux->adr->inf=StergereSf(aux->adr->inf);
			delete aux->adr;
			aux->adr=NULL;
		}

		else {  while (p->inf)
			p->inf=StergereSf(p->inf);
		delete p;
		p=NULL;} 

	}
	return p;
}


void main()
{
	FILE *f1;
	f1=fopen("Jucatori.txt","r");
	Nod *Lista=NULL;
	char n[100],m[100],c[100],poz[20],val[100];
	Jucatori player;
	while (!feof(f1))
	{   
		player.serie=new int;  fscanf(f1,"%d",player.serie);

		fscanf(f1,"%s %s %s %s ",&n,&c,&poz,&m);

		player.Agent_Jucator=new char[strlen(n)+1];
		strcpy(player.Agent_Jucator,n);

		player.Nume_Jucator=new char[strlen(c)+1];
		strcpy(player.Nume_Jucator,c);

		player.Pozitie_Jucator=new char[strlen(poz)+1];
		strcpy(player.Pozitie_Jucator,poz);

		player.Varsta_Jucator=new char[strlen(m)+1];
		strcpy(player.Varsta_Jucator,m);

		player.Valoare_Jucator=new char[strlen(val)+1];
		strcpy(player.Valoare_Jucator,val);

		player.Pret=new float;     fscanf(f1,"%f",player.Pret);
		InserareSfarsit(&Lista,player);
	}
	//Afisare(Lista);

	Conversie(&Lista);

	FILE *f2;
	f2=fopen("Afisare.txt","w");
	fprintf(f2,"\n Parcurgerea in inordine este : \n");
	inordine(f2,Lista);

	fprintf(f2,"\n Elementele cautate sunt : \n ");
	cauta(Lista,250,2000,f2);

	Lista_liste* cap=NULL;
	creare_Lista_liste(&cap,Lista);

	afisare_Lista_liste(cap);

	Lista=stergearbore(Lista);
	if (Lista!=NULL) inordine(f2,Lista);
	else cout<<"\n Arborele a fost sters ";

	while(cap)
		cap=Stergere(cap);
	if (cap==NULL) cout<<"\n Lista de liste a fost stearsa \n ";
	else cout<<"\n lista de liste nu e stearsa \n";
	fclose(f2);

}

ok, i just ran it... and it also tells me this debug assertion at lin 44 stuff.

You open a file at the second line of the main function... and on my system that file is obviously not there, so the f1 pointer points to zero.
then it reaches the line
while (!feof(f1))

and because f1 is zero it crashes with the debug assertation you mention. So probably that file is not there on your system, or you have se the working directory in the wrong folder.

Anyway, better to check if that file pointer f1 is zero or not before proceeding.
Topic archived. No new replies allowed.