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".
Code:while(fgets(bufrftext,1200,fp) { printf("the read string is :%s"bufftext"); i=strcmp(bufftext,"rohan sharma") printf("the value of i :%d",i); }
- the expected o/p is :
- the read string is : rohan sharma
- the value of i : 1// this o/p should always comes 0 .
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.