How to do this simple program? any help please? still a beginner here

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<iostream>
int main()
{
char findname[15],pnum[15],fname[15],lname[15];
FILE *fp;
fp=fopen("file1.txt","r");
printf("Find criminal I.D number:");
scanf("%s",&findname);
while(!feof(fp))
{
fscanf(fp,"%s %s %s\n",&pnum,&fname,&lname);
if(strcmpi(findname,fname)==0||strcmpi(findname,lname)==0||strcmpi(findname,pnum)==0)
{
printf("\n\n%s %s %s\n",pnum,fname,lname);
printf("\nFound %s %s %s\n",pnum,fname,lname);
}
if(strcmpi(findname,fname)!=0||strcmpi(findname,lname)!=0||strcmpi(findname,pnum)!=0)
printf("There are no Criminal Records Found\n",findname);
}
fclose(fp);
getch();
}







======> simple, i just want to remove that many "no criminal records found, and then and what should i declare? can someone fix this for me, file handling problems.. thank you :)
You know there's a beginners section of the forum, and you REALLY need to wrap the code in tags (It shows you how in beginners posting bit).
Topic archived. No new replies allowed.