Skip to content

Instantly share code, notes, and snippets.

@aaronryank
Created June 6, 2016 21:49
Show Gist options
  • Save aaronryank/8d68bc35065a5c37b787b8324ef689c7 to your computer and use it in GitHub Desktop.
Save aaronryank/8d68bc35065a5c37b787b8324ef689c7 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int getword(char *fmt, int delim, FILE *buf)
{
int c, x;
while (((c = getchar()) != EOF) && (c != delim))
fmt[x++] = c;
return x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment