Here's the code which i wrote but it gave me a whole bunch of errors.. Plz cud u help me out with this....
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
int main()
{
FILE *in_file;
char dataFile[20];
printf("Ënter file name");
scanf ("%s", dataFile);
in_file = fopen(dataFile, "r");
std :: string date;
std :: string operator;
std :: string task;
in >> date >> operator;
getline(in,task);
if (task.find("Vendor Setup") != string::npos)
{
printf("Data found");
}
return 0;
}
The following are the errors which were listed when I compiled the code:
filterdaa.c
filterdaa.c(15) : error C2143: syntax error : missing ';' before ':'
filterdaa.c(16) : error C2143: syntax error : missing ';' before ':'
filterdaa.c(17) : error C2143: syntax error : missing ';' before ':'
filterdaa.c(19) : error C2065: 'in' : undeclared identifier
filterdaa.c(19) : error C2065: 'date' : undeclared identifier
filterdaa.c(19) : error C2065: 'operator' : undeclared identifier
filterdaa.c(19) : warning C4552: '>>' : operator has no effect; expected operato
r with side-effect
filterdaa.c(20) : error C2065: 'task' : undeclared identifier
filterdaa.c(22) : error C2224: left of '.find' must have struct/union type
filterdaa.c(22) : error C2065: 'string' : undeclared identifier
filterdaa.c(22) : error C2143: syntax error : missing ')' before ':'
filterdaa.c(22) : error C2059: syntax error : ')'
filterdaa.c(28) : error C2059: syntax error : 'return'
filterdaa.c(29) : error C2059: syntax error : '}'
I've no clue now as to wht has 2 be done..plz help me out...