I am writing a program that will list 15 students by student number, student name, and their 5 test grades in a table while using a stucture.
examaple:
1 John Doe 94 87 56 42 99
2 Jane Doe 99 89 81 72 100
I want to prepopulate the table with the student number and the student name, and print it out to make sure the table looks ok.
The student name is a string of characters that will vary in length, and this is where I get stuck, complier is returning an "illegal zero-sized array.
I can't figure how to get the variable length students name into the table, please see code snippet, and please help
Code:
struct sgrades
{
int number;
char names[];
int test1;
int test2;
int test3;
int test4;
int test5;
} grade[16];
struct sgrades grade[16] = {{0, 0}, {1, Jon Doe}, {2, Jane Doe}, {3, 1}, {4, 1}, {5, 1}, {6, 1}, {7, 1}, {8, 1}, {9, 1}, {10, 1}, {11, 1}, {12, 1}, {13, 1}, {14, 1}, {15, 1}};