if i read a file whenever i read it line by line while reading i try to check it with some string by the strcmp command .This is like thats
the string to be read from file is "rohan sharma".
while(fgets(buf rftext,1200,fp)
{ printf("the read string is :%s"bufftext") ;
i=strcmp(buffte xt,"rohan sharma")
printf("the value of i :%d",i);
}
please try to help me in this issue if want to remove the unwanted character that comes along the string which you read from file that makes string comparision impossible.
the string to be read from file is "rohan sharma".
while(fgets(buf rftext,1200,fp)
{ printf("the read string is :%s"bufftext") ;
i=strcmp(buffte xt,"rohan sharma")
printf("the value of i :%d",i);
}
- the expected o/p is :
- the read string is : rohan sharma //this o/p comes
- the value of i : 0// this o/p is always 1.
please try to help me in this issue if want to remove the unwanted character that comes along the string which you read from file that makes string comparision impossible.
Comment