I loarded the data from word.txt into array structure, but i want to print this like the output. How can I print that?

Viewed 32

struct word { char wordname[200]; };

struct word word1[200];
int i = 0;

FILE *fp = NULL;

fp = fopen("word.txt", "r");

if (fp != NULL)
{
    while (fgets(word1[i].wordname, sizeof(word1), fp))
    {

        i++;
    }

    fclose(fp);
}

return 0;

FOUND: [fine] has [4] definitions:

  1. {adjective} of high quality.
  2. {adjective} (of a thread, filament, or person's hair) thin.
  3. {noun} very small particles found in mining, milling, etc.
  4. {adverb} in a satisfactory or pleasing manner; very well.
0 Answers
Related