Sep 22, 2010 at 2:05am UTC
hi..
..I made a program in c++ that will read from a text file...'
..here's my code...but the output of that program is always..."Files Not Found!'
..is there any wrong with my code?...
.please tell me...'tnx'
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<fstream.h>
main()
{
char en[10],code[10],fname[20],lname[15],pos[30];
clrscr();
ifstream in("F:midterm.txt");
in>>code>>fname>>lname>>pos;
cout<<"Employee Number : ";
cin>>en;
if (strcmpi(code,en)==0)
{
cout<<"Employee Name : "<< fname<<lname<<endl;
cout<<"Position : "<< pos<<endl;
}
else
{
cout<<"Files Not Found!"<<endl;
}
in.close();
getch();
return 0;
}
Last edited on Sep 22, 2010 at 2:06am UTC
Sep 22, 2010 at 2:14am UTC
"f:/ midterm.txt"
EDIT: And I would suggest you get a compiler written after 1998.
Last edited on Sep 22, 2010 at 2:15am UTC
Sep 22, 2010 at 2:24am UTC
..ukie..tnx'
..can you give me the syntax of tokenizing or the use of "STRTOK"?
..and a short sample program if you wont mind..'tnx again'