Created
June 30, 2021 14:38
-
-
Save alsamitech/d579fff3499a728f46a0f4f6b67eb13c to your computer and use it in GitHub Desktop.
contains_char - returns true if the string contains the character. If your C compiler doesn't support _Bool, just use char instead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _Bool contains_char(char* str, char contains){ | |
| while(*str){ | |
| if(*str==contains) | |
| return 1; | |
| str++; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment