/* COMP 2401/2001 W13 You have to know what is happening with arrays. Some basic opertors do not behave as you might initially expect them to. Arrays cannot be "copied" with the "=" assignment operator like primitive types can. Using "==" equality operator only checks for pointer equality. It does not check if the contents of two arrays are the same or not. Using one of the relational operators <, <=, >, >= will check pointer values. You can use these but they have nothing to do with the data in the array. They check if one pointer is located in memory before or after another. mjh 2013 */ #include int main(){ int a[] = {1,2,3,4,5}; int b[] = {1,2,3,4,5}; int *c = a; /* uncomment this code and see the error //int d[5] ; //d = a; // annot copy an array with "=" operator */ printf("(a == b) is "); if( a==b ) printf("true\n"); else printf("false\n"); printf("(a == c) is "); if( a==c ) printf("true\n"); else printf("false\n"); printf("(b == c) is "); if( b==c ) printf("true\n"); else printf("false\n"); }