This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> /* getchar() */ | |
#include <stdlib.h> /* malloc(), realloc() */ | |
#include <string.h> /* memcpy() */ | |
/* ----------------------------------------------- | |
* Create a new string (NUL-terminated array of chars) by reading the stdin. | |
* Return the newly created string, or NULL on error. | |
* Args: | |
* int beExact: If 0 (false), then the size of the created string will | |
* be an exact multiple of the internally used alloc-ahead |