What is the fastest method to check if all elements of an array(preferable integer array) are equal. Till now I have been using the following code:
bool chec
int check(const int a[], int n) { while(--n>0 && a[n]==a[0]); return n!=0; }