ok suppose i have a class called members, and all the members are listed by their id (ie the first one is 1, second is 2, etc.) and i want to check each member for a certain property, how would i do that? ok that didnt make much sense, so i want to do something to this effect.
so basicly i want to quickly go through each member and check to see if one of their variables equals something. that way if i was to add another member, i could check to see if the variable number i was going to asign them is taken or not.Code://this is just fragments of code, not an actual code //also members have a number as well as an ID, they are listed by ID and have a number that is used for something else class members { public: int getNumber(); members(); //constructor private: int number; } int members::getNumber() { return number; } for(int n = 1; n <= m; n++) //m is a variable with the total number of members of the class { a = n.getNumber(); if(a == 0240) { //do something here } }
thanks in advance for your help