You cannot store name or word 'of any length' (we have finite-storage machines).
Anyway, your best bet is
fgets[
^]:
#include <stdio.h>
#include <string.h>
int main()
{
enum
{
SIZE = 256,
};
char name[SIZE];
for(;;)
{
printf("please enter your name ('quit') to terminate: ");
fgets(name, sizeof(name), stdin);
if ( strncmp(name, "quit", 4) == 0)
break;
printf("hi %s", name);
}
printf("goodbye\n");
return 0;
}