Void functions & Struct

I'm trying to create a print void function, however I'm not understanding how to call the database in the print function. I've tried to do something similar to what is in my textbook but all I'm getting is errors. This is what I've done so far.

I'm trying to create a print void function, however I'm not understanding how to call the database in the print function. I've tried to do something similar to what is in my textbook but all I'm getting is errors. This is what I've done so far.

I'm still getting an error. It says my variables are undeclared, the ones I have so far in the print function. I want it to use the variables from struct Student. How do I do that? I want it to be able to use a generic one for 3 students. I was trying it with 'a' first to see how it works.

The problem is that you are passing a particular structure to your printstudent function BUT you are not actually using that data. Let me explain with an example:

int main()
{
Student FirstStudent; // Make a student
Student SecondStudent; // Make a DIFFERENT student
// Now populate the student with infomation
printstudent(FirstStudent); // Print only about first student
std::cout<<"Now write about second"<<std::endl;
printstudent(SecondStudent);
}

Note that in the above code, you call printstudent with the object that is required to be printed.
Not with a definition e.g. This is wrong: printstudent(Student& a); In the code the student writing should work with each student passed to the function.
in your function you do not do that. So change it to something like this:

I'm still getting an error. It says my variables are undeclared, the ones I have so far in the print function. I want it to use the variables from struct Student. How do I do that? I want it to be able to use a generic one for 3 students. I was trying it with 'a' first to see how it works.

Yeah, I get it. I've chosen not to use arrays in this simple one because it is only 3 students and I've been able to keep track of it easily.
I do have one final question. How do I take my questions and put them into a void function?
I tried this

Yeah, I get it. I've chosen not to use arrays in this simple one because it is only 3 students and I've been able to keep track of it easily.
I do have one final question. How do I take my questions and put them into a void function?
I tried this