no sh it really????? get a grip on life here, that is just stupid nit picking. un realist nit picking here as far as I see. I know I am not going to put in over 300 chars to test it. so slow down.
the OP has his for 1000 the same can be said about his too. if it is 1001 it is truncated, oh my lets all of you get a grip on yourselves. One programs it to the size they allow to be used. I decided to use 300 because I know I am not about to type in anything over 300 or even close to 300. that is a good ball park number for my purpose. thank you very much.
yes you did. so now I got another function for checking that. but as I stated in my other post in here to Mr ocpd perfect ... I am not going to repeat it.
once by fgets() just returning as much as it can, leaving the rest to be read later, and again by your code, chopping off the last character in sentence whether it is a \n or not. One of the reasons I showed you the method I did is because unlike strlen(), strcspn() returns the highest subscript if it doesn't find anything.
I never said it was and that is your option I just grabbed a thought, it was. get each word separately then check it against the search word, and it does that. does it have room for improvement> I do not care at this moment in my life. It was just something I did to see if I could. and I accomplished it. time to move on. it is and was not intended for the OP.
As far as your code goes, the OP's code could have easily been improved as is... maybe check for ' ' or the first character in the word before starting the inner loop, instead of only looking for the first character in word... this makes it so spaces are taken into account.
Your solution does too much. It's just not necessary to do it the way that you are.
my code was not even intended for the OP I was doing nothing to it other then stating what I found. period. the function I wrote was me just trying to figure out a different way for doing it. and nothing more. It was never intended to be used in anything. period. I just posted it.
Your solution does too much. It's just not necessary to do it the way that you are
really? are you serious? it removes each word one at a time looks at it against the other word if match count if not don't count I guess I could have had it look at each word by one letter at a time, then it too can be said that it does too much and is not necessary as well.
mine works. it does exactly what I wrote it to do. so yes it is good code.
is there another way to grab each word separately? I am sure there is and if so then woo hoo for that too.