I'm basically trying to read data from a file while ignoring all non alphabetic characters and any characters preceding a non alphabetic would be considered the end of the word and should be inserted into a trie. any ideas? Heres my current code which is getting a seg fault
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
char input;
void readDict(FILE *dict_file)
{
int line = 0;
char curr;
while ( (curr = fgetc(dict_file))!= EOF)
{
if(isalpha(curr))
{
strcpy(input,curr);
}
}
}
int main(int argc, char * argv[])
{
if (argc < 2)
printf("invalid input");
else
{
FILE *pFile = fopen(argv[1],"r");
readDict(pFile);
}
return 0;
}