Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 20th, 2011, 07:53 PM
Asjad Ali (Shub Asjad Ali (Shub is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 2 Asjad Ali (Shub User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 56 sec
Reputation Power: 0
Question 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. .

Reply With Quote
  #2  
Old May 20th, 2011, 08:02 PM
Asjad Ali (Shub Asjad Ali (Shub is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 2 Asjad Ali (Shub User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 56 sec
Reputation Power: 0
if(wardno==p.wardno)

if(asgwardno==d.asgwardno)

and these are the error lines of those functions.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > 648 I:\SP11-BCS-072\project.c [Warning] comparison between pointer and integer

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap