Array of Strings from function 
Author Message
 Array of Strings from function

How do I return an array of Strings from a function? Below is some code that
doesn't compile.

String * GetStrings(void)
{
    String *str __gc[] = new String*[10];

    str[0] = new String("1");
    str[1] = new String("2");
etc,etc.

    return str;

Quote:
}

Thanks.


Sat, 17 Sep 2005 17:59:43 GMT  
 Array of Strings from function

Quote:

> How do I return an array of Strings from a function? Below is some
> code that doesn't compile.

just replace

String * GetStrings(void)

with

String * GetStrings(void) []

--
Greetings
  Jochen

  Do you need a memory-leak finder ?
  http://www.codeproject.com/useritems/leakfinder.asp



Sat, 17 Sep 2005 18:14:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problems passing arrays of Strings to function.

2. passing arrays of strings to functions?

3. Copy Array string to another Pointer array string in ANSI-C

4. Passing array of strings to a function?

5. strings/arrays and functions

6. function parameters to pass a VB string array to a C++ DLL

7. Function to return array of strings

8. finding the closest match of a string compared to an array of strings

9. Putting strings into arrays of strings

10. convert list to array, arrays of pointers (to strings)

11. Arrays and arrays of strings problem

12. String Arrays and string parsing

 

 
Powered by phpBB® Forum Software