Unable to compare string from file

i wanted to compare a string and number stored in a file "Albums.zu" with a string and number entered by the user. I wrote the following code

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
void album::getdata()
{
	char found='n';
	clrscr();
	gotoxy(30,3);
	cout<<"Album Name : ";
	gotoxy(10,6);
	cout<<"Director : ";
	gotoxy(42,6);
	cout<<"Music Director : ";
	gotoxy(10,7);
	cout<<"Year : ";
	gotoxy(42,7);
	cout<<"Language : ";
	gotoxy(10,8);
	cout<<"Number of tracks : ";
	gotoxy(42,8);
	cout<<"M.R.P : Rs.";
	gotoxy(5,11);
	cout<<"Tracks : ";
	gotoxy(43,3);
	gets(name);
	gotoxy(21,6);
	gets(director);
	gotoxy(59,6);
	gets(md);
	gotoxy(17,7);
	cin>>year;
	fstream file;
	file.open("Albums.zu",ios::in|ios::out);
	file.seekg(0);
	while(!file.eof())
	{
	file.read((char*)&obj,sizeof(obj));
	if((strcmp(obj.name,name)==0)&&(year==obj.year))
		{
		found='y';
		break;
		}
	else
		{
		found='n';
		}
	}
	file.close();
	if(found=='y');
		{
		gotoxy(23,17);
		cout<<"\aAlbum already present in database";
		gotoxy(18,18);
		cout<<"Kindly use 'Purchase existing album' option";
		getch();
		purchase_menu();
		}
	gotoxy(53,7);
	gets(language);
	gotoxy(29,8);
	cin>>trcks;
	gotoxy(53,8);
	cin>>mrp;
	for(int i=1,j=13;i<=trcks;i++,j+=3)
		{
		gotoxy(5,j);
		cout<<i<<". ";
		titles[i].getname();
		gotoxy(8,j+1);
		cout<<"Artists : ";
		gotoxy(18,j+1);
		titles[i].getartists();
		}
}


obj is an object of class "album" and getdata a memberfunction.
THe problem is that, whatever string and year i enter, the below message comes up
Album already present in database
Kindly use 'Purchase existing album' option

Why is the comparison not working properly...help please...
Solved.... there was an ; at the end of if
Topic archived. No new replies allowed.