Skip to content

Instantly share code, notes, and snippets.

@anoopemacs
Created August 27, 2016 20:27
Show Gist options
  • Select an option

  • Save anoopemacs/451385a3a225d7d6fcf6fe194bb5efa4 to your computer and use it in GitHub Desktop.

Select an option

Save anoopemacs/451385a3a225d7d6fcf6fe194bb5efa4 to your computer and use it in GitHub Desktop.
loop until a blank line or EOF
char buf[2];
while (scanf("%1[\n]", buf) == 0) { // loop until a blank line or EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment