Skip to content

Instantly share code, notes, and snippets.

@alsamitech
Created July 23, 2021 17:35
Show Gist options
  • Select an option

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

Select an option

Save alsamitech/1610657a9c814d1bbdbca8086443058d to your computer and use it in GitHub Desktop.
starts_with - starts with but even better (replace _Bool with char if you're using anything before C99)
_Bool starts_with(const char* in, const char* sw){
for(size_t i=0;sw[i];i++)
if(in[i]!=sw[i])
return 1;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment