Hello, I need a little help reading input from a file and placing it into a structure.
The file looks like this:
this particular file contains 3 separate patches which belong in 3 different structures. rect, ex, and dollar belong in the name portion of the structures, the two numbers belong with the height and width portions, and the symbols belong in the two-dimensional array.Code:rect 7 9 +-------+ | | | | | | | | | | +-------+ ex 5 5 * * * * * * * * * dollar 1 1 $
The stucture I have created:
I have opened the file but am unsure of how to go about filling the structure with the information contained within the file. Any help will be appreciated...Code:#define M 24 #define N 79 #define NAME 10 typedef struct { char name[NAME]; int height; int width; char patch[M][N]; }patch;