#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<getline.h>

int main() {
  char *line, *line2;
  ssize_t num;
  size_t len = 0;

  printf("Please input a line\n");
  num = getline(&line, &len, stdin);
  if(line) {
     printf("Retrieved line of length %u :\n", num);
     printf("The maximum line length %u :\n", len);
     printf("line = %s", line);
     free(line);
  }

  printf("Please input a line\n");
  line2 = (char *)malloc(100);
  len = 100;
  num = getline(&line2, &len, stdin);
  printf("Retrieved line of length %u :\n", num);
  printf("The maximum line length %u :\n", len);
  printf("line2 = %s", line2);
  free(line);

}
