I'm having trouble with this part of the assignment in the "void display(Leads x)" section: Ask the user if they would like to see only active leads Y or N for all leads. If yes ("y"), check struct element and only display the elements that active is assigned true with. If 'n', display all leads.
Does anyone know how to check each struct element? Any help would be greatly appreciated.
There's no way to iterate over each member of a structure. You're going to have to explicitly check each member.
But surely you only want to check the active member?
Or are you talking about iterating over each element of the names array? In that case, you can just loop in the same way as you do at line 21. Use the array index to access the element, and then check the active member of that element.
By the way, there's no need for that duplication of code at lines 39-43 and 49-53. You can do that stuff once before the if statement, and just set the active member inside the conditional block.
Loop over the array, and access each element of the array, exactly as you're already in your main function. Then access the active member of the element, exactly as you're already doing in your enterLead function.