Skip to content

Instantly share code, notes, and snippets.

@alsamitech
Created June 30, 2021 14:38
Show Gist options
  • Select an option

  • Save alsamitech/d579fff3499a728f46a0f4f6b67eb13c to your computer and use it in GitHub Desktop.

Select an option

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
_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