Skip to content

Conversation

sadeem-albir
Copy link
Contributor

By starting the comparison loop from '\0', you are making the t_length variable finish too early, leaving out the last letter unchecked for equality. Try 'printf("%d", strend("my cat", "dat"));' and you'll get an output of 1.

By starting the comparison loop from '\0', you are making the t_length variable finish too early, leaving out the last letter unchecked for equality. Try 'printf("%d", strend("my cat", "dat"));' and you'll get an output of 1.
@ohkimur
Copy link
Owner

ohkimur commented Apr 1, 2024

@sadeem-albir Thanks for the contribution!

@ohkimur ohkimur merged commit 5daa9d8 into ohkimur:main Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants