Skip to content

Instantly share code, notes, and snippets.

@jvns
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvns/698e1e2f4d4ba5154f1b to your computer and use it in GitHub Desktop.
Save jvns/698e1e2f4d4ba5154f1b to your computer and use it in GitHub Desktop.
exercise_solutions.md

Exercise 1

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>

#include "utils.h"

int main(int argc, char **argv) {
  while(1) {
    printf("yay shell> ");
    char *line = NULL;
    size_t capacity = 0;
    getline(&line, &capacity, stdin);
    printf("%s", line);
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment