
May 20th, 2011, 07:53 PM
|
|
Registered User
|
|
Join Date: May 2011
Posts: 2
Time spent in forums: 29 m 56 sec
Reputation Power: 0
|
|
648 I:\SP11-BCS-072\project.c [Warning] comparison between pointer and integer
em a newbie and Em working on my project from my uni and having this trouble . . i have to get outta trouble . . cz i have to submit it on monday. . thats a hospital managment system . . 2 functions which are makin trouble
are following:
void que_wardno(FILE *fp);
function prototype for query by ward no. of PATIENTS
void que_asgwardno(FILE *fd);
function prototype for query by assigned ward no of DOCTORS
error window shows
In function `que_wardno':
In function `que_asgwardno':
[Warning] comparison between pointer and integer
and the code is :
<code>
void que_wardno(FILE *fp)
{
int wardno, flag =1;
printf("Enter Ward No. of Patient: ");
scanf("%d",&wardno);
rewind(fp);
while(fread(&p,sizeof(p),1,fp)==1)
{
if(wardno==p.wardno)
{
flag =0;
printf("\nPt.No\t\t Name \t Age\tGender \tDisease/Symptoms ");
printf("\nDate of Admit\tDate of Discharge\tWard No.\t Tests ");
printf("\n%4d%15s\t%3d %5s %15s %8s %8s %5d %15s",
p.ptno, p.name, p.age, p.gender, p.disease, p.addate, p.disdate, p.wardno, p.test);
}
}
if (flag)
printf("--> NO Record Exist about This Ward No <--");
} [SIZE=7]
</code>
2nd is
<code>
void que_asgwardno(FILE *fd)
{
int asgwardno, flag =1;
printf("Enter Ward No: ");
scanf("%c",&asgwardno);
rewind(fd);
while(fread(&d,sizeof(d),1,fd)==1)
{
if(asgwardno==d.asgwardno)
{
flag =0;
printf("\nPt.No\t\t Name \t Age\tGender \tDisease/Symptoms ");
printf("\nDate of Admit\tDate of Discharge\tWard No.\t Tests ");
printf("\n%4d%15s\t%3d %5s %15s %8s %8s %5d %15s",
p.ptno, p.name, p.age, p.gender, p.disease, p.addate, p.disdate, p.wardno, p.test);
}
}
if (flag)
printf("--> NO Record Exist about This Ward No. <--");
} // Closing QUERY BY ASSIGNED WARD No. FUNCTION
</code>
Kindly help me with this. .
|