Using the following code:
char *name = malloc(sizeof(char) + 256); printf(\"What is your name? \"); scanf(\"%s\", name); printf(\"Hello %s. Nice to meet y
getline()
Now part of POSIX, none-the-less.
It also takes care of the buffer allocation problem that you asked about earlier, though you have to take care of freeing the memory.
free