Pointer to String Array Question

Hi I'm working on a school assignment and am having difficulty understanding how to implement part of it.
I have to create a function with this exact signature:
 
  int getNumPossibleSigns(string* letterInventory, string* addresses, int length);

The return value is the number of strings are able to be created from a pool of characters if the characters can only be used once. For example if
1
2
  string letterInventory = "AAAABCCC123456789";
  string addresses[] = {"123C","123A","123 ADA"};

the output would be 2 because only the first two strings can be created.
My question is how would I access each element in the array if there is no array parameter for addresses (it is string* addresses not string addresses[ ]) in my function?
Last edited on
When passing single dimensional arrays to functions the following are all equivalent function signatures.

1
2
3
int getNumPossibleSigns(string* letterInventory, string* addresses, int length);
int getNumPossibleSigns(string* letterInventory, string addresses[], int length);
int getNumPossibleSigns(string* letterInventory, string addresses[4], int length);

Topic archived. No new replies allowed.