I'm writing a C program which I was reading a bunch of data from a txt.file into a list of struct. And I was just told that we can't read data from another file and all the data should be contained in one c file. Is there any way to create the list without hard coding one by one?
Parts of my data is like following:
.
period
?
Question Mark
!
Point
-
Dash
/
slash
+=
Plus equal
>=
greater than or equal
And I want to put them in the following list, except for doing it line by line, is there any better way to build this long list?
typedef struct info
{
char ch[10];
char name[50];
}INFO;
int main(int argc, char* argv[])
{
INFO list[50];
strcpy(list[0].ch,".");
strcpy(list[0].name,"period");
.....
}