Because your parameter for the ShuffleCards function references a single FlashCard object, and since it is not an array, you are not permitted to use the subscript operator. If you're trying to pass the whole array do something along these lines: void ShuffleCards(FlashCard card[])
When I change void ShuffleCards(FlashCard &card) into void ShuffleCards(FlashCard card[]),there are on warnings on line 22 and 23 anymore,but there are warnings on line 29 and 30 saying that no matching function for call to 'SwapFlashCard'.
Is my definition of SwapFlashCard wrong?
(1) You would call the function like so: ShuffleCards( array_name );
As far as errors on 29/30, you have to look at the types of variables you are passing.
SwapFlashCards takes two parameters both of which or FlashCard objects. On lines 29/30 you are not pass FlashCard objects, you are passing char[i].a, card[r].a, card[i].b, card[i].b, which are all ints defined inside the FlashCard object, but ints nonetheless. So your compiler is telling you that there is no SwapFlashCards(int, int) function.
So the right way to correct line is to combine line 29 and 30 into SwapFlashCard(card[i],card[r])? In this way,does the function will also swap each a and b member variables inside each card object?