I have a project to display the members of the family who lives in the same state and the average age of all members. I got the part of the average age but now im stuck trying to display only the members that live in Florida. Im able to display all members but I need just the ones in who lives in Florida.I tried to use State='Fl' but it didnt work Thank you in advance....
I think it should be something like:
if(State='Fl')
{
// displaying the stored data
cout << i << " First name: " << fami[i].Name << endl;
cout << " Last Name: " << fami[i].LastName << endl;
The ' ' are used for single characters only so you should have gotten a compile error for 'Fl' I believe. Use the " " for strings, which can be composed of several characters, numbers, and symbols.
Also note that in C++:
= is not the same as ==
The former is for assignment, assigning things into variables and the latter is for the logical "equals".