Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

So im learning to program in c : specifically dynamically allocated arrays of st

ID: 3667778 • Letter: S

Question

So im learning to program in c :

specifically dynamically allocated arrays of structs... how can I do this? how can I access variables in a struct thats in an array like the one below?

Struct Student { Char** Fullname;//2d character array where Fullname[0][0-n] stores the first name and Fullname[1][0-n] stores the last name

int * ID#;   int GPA; Char Grade;   Char* Schoolname; }

How would I scan in the information from the standard input for each of these variables?

How would I use them? like a string compare or printing? and when do i use "->" vs "."

Explanation / Answer

and when do i use "->" vs "."
ANS. -> is used when you want to access via pointers.
say you had a variable,
Student x;
scanf("%s", &x.Fullname[0]);

scanf("%s", &x.Fullname[1]);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote