What if you drop the pointers ..
char ch;
char word[45];
for (int i = 0; ;i++)
{
ch = fgetc(ptr);
word[i] = ch;
if (ch == 10)
{
break;
}
}
printf("%s\n", word);
CLICK HERE to find out more related problems solutions.