ok I have been trying to figure this out on my own for the longest time and am finally giving up. Im tyring to have set an array equal to a function. Here is a simplified version of what im doing.

#include <iostream.h>

int test();

int main(){

int i;
int t[] = test();
for (i=0; i<9; i++) { cout << t[i]; }

return 0;
}


int test() {
int array[9];
int i;

for (i=0; i<=9; i++) { array[i] = i; }
return array;
}


Can some tell me the "legal" way of doing this is.

Thank You

Matthew Ozor
[email protected]