#How do I specify in the if statement that the variable is equal to any of the numbers

1 messages · Page 1 of 1 (latest)

tepid ridge
#

that the variable is equal to any of the numbers in the month31 array?

kindred spruce
#

Make another function to check if the array contains a value.

template<class C, typename T>
bool contains(C&& c, T t) {
    return std::find(std::begin(c), std::end(c), t) != std::end(c);
);
tepid ridge
#

thnx

pulsar pine
#

That is a fine solution, but if you use that and a teacher sees it a huge red flag is going to go up

#

"loop over month31" and check each element against appo1.date[1]"