Don't understand the assignment.. can somebody clarify?

Oct 29, 2012 at 1:06am
Write a function
bool equals(int a[], int a_size, int b[], int b_size)
that checks whether two arrays have the same elements in the same order.

I'm not understanding exactly what I'm supposed to do here and don't know where to start. Can somebody break it down into simpler terms perhaps?
Oct 29, 2012 at 1:09am
It's pretty simple. You are given 2 arrays, 'a' and 'b'. You simply have to compare them to make sure they contain the same elements.

Example:
1
2
3
4
5
a = {1,2,3,4,5}
b = {1,2,3,4,5}  <- would result in true

a = {1,2,3,4,5}
b = {1,2,4,3,5}  <- would result in false
Oct 29, 2012 at 1:11am
So should i type a code that asks for input and then compares it?
Oct 29, 2012 at 1:29am
You can (and should) write such code to verify your function works properly, but if that's all there is to the assignment, it's not necessary.
Oct 29, 2012 at 2:29am
also, realize there are four arguments in your function. you need to make sure both arrays have the same NUMBER of elements, and that those elements are in the same ORDER.
Topic archived. No new replies allowed.