Here is a real simple answer, and I think it works. I really don't know much about c, so don't blame me if it doesn't, but if you re declare the string length every time, shouldn't it not reset?

Anyway, here is what I found to work pretty well:
Code:
#include <stdio.h>
#include <string.h>

int main()
{
  int x = 0;                                        
  char word[x];                                     
  while ((word[x] = getchar()) != '\n') {           
	++x; 
    char word[x];                            
  }
  word[x]='\0';                                     
  printf("%s",word); 
  getchar();
  return 0;
}
If this doesn't work, or my logic is flawed, please point that out.
Thanks
-Matt