Skip to content

Instantly share code, notes, and snippets.

@mskorzhinskiy
Created February 25, 2016 07:51
Show Gist options
  • Save mskorzhinskiy/120dd8912d9743869faa to your computer and use it in GitHub Desktop.
Save mskorzhinskiy/120dd8912d9743869faa to your computer and use it in GitHub Desktop.
Reading from input
#define STRING_MAX_LENGTH 256
void read_some_input_snipper {
char *result;
char *name;
char buf[STRING_MAX_LENGTH];
fgets(buf, sizeof(buf), stdin);
ssprintf(buf, "%s%[^\n]", name, result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment