R
Riaan Cillié
Hi
I'm trying to learn C, but I am struggling with using scanf and a struct. I
want to define a structure and declare a variable of that type in int main.
This has to be passed to a function and its values have to read and returned
from this function. How do you use gets() for this? I just can't figure it
out.
Here is a bit of code
typedef struct sStudent
{
char *Name;
char *ID;
} tStudent;
void ReadStudents(tStudent student[10])
int main()
{
tStudent student[10];
ReadStudents(student);
}
void ReadStudents(tStudent student[10])
{
????????????
}
I'm trying to learn C, but I am struggling with using scanf and a struct. I
want to define a structure and declare a variable of that type in int main.
This has to be passed to a function and its values have to read and returned
from this function. How do you use gets() for this? I just can't figure it
out.
Here is a bit of code
typedef struct sStudent
{
char *Name;
char *ID;
} tStudent;
void ReadStudents(tStudent student[10])
int main()
{
tStudent student[10];
ReadStudents(student);
}
void ReadStudents(tStudent student[10])
{
????????????
}