Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created October 5, 2016 15:36
Show Gist options
  • Save AndyNovo/9332bfdfcaa5e6fce4eb0cc59013edb6 to your computer and use it in GitHub Desktop.
Save AndyNovo/9332bfdfcaa5e6fce4eb0cc59013edb6 to your computer and use it in GitHub Desktop.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
size_t bytes = 256;
char* p2chunk = (char *)malloc(bytes);
getline(&p2chunk, &bytes, stdin);
printf("%s\n", p2chunk);
free(p2chunk);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment