일단 소스는
#include
#include
#define MAX 40
int main(void)
{
FILE *fp;
char words[MAX];
if((fp = fopen("wordy.txt","a+"))==NULL){
fprintf(stdin,"Can't open\"words\"file.\n");
exit(1);
}
puts("enter words to add to the file ; press the Enter");
puts("Key at the beginning of a line to terminate.");
while(gets(words) != NULL && words[0] != '\0')
fprintf(fp,"%s ", words);