if i have a struct like this...
Code:
typedef struct student_profile{
long long int stud_num;
char name[50];
char bday[50];
char course[50];
} STUDENT;
then i have an array of the given struct above...
how could i tell if the slot in the array is free or not [null or not]? [for finding free slots in the array & for stopping when displaying all the data in the array]...
will this work?
Code:
for(i = 0; i < 20; i++)
{
if(array[i].stud_num == NULL)
{
free = i;
break;
}
}
and then assign like "array[free].name, etc..."?
thanks in advance!