Check if all elements in vector are equal
bool vec_is_equal( const vector & vIn )
If all elements in vector are equal, return true, else return false
EX1
void vec_is_equal_ex1() { vector v1 = {1, 1, 1, 1}; vector v2 = {0, 1, 1, 0}; bool b1 = vec_is_equal(v1); bool b2 = vec_is_equal(v2); if (b1) printf ("v1 is equal\n"); else printf ("v1 is not equal\n"); if (b2) printf ("v2 is equal\n"); else printf ("v2 is not equal\n"); }
ocmath_compare_data
origin.h