Thomas Kowalski schrieb:
Hi everyone,
recently I have trouble to pass an array (unsigned char color[3]) to a
methode by reference and collect the return value by reference.
I wanted something like:
unsigned char[3]& changeColor(unsigned char[3]& color);
If you pass the array to the function by reference, why
do you wnat to return it as a reference as well ?
How would the correct syntax look like?
I'd use a typedef:
typedef unsigned char Color[3];
Color& changeColor(Color & col)
{
return col;
}
int main()
{
Color c;
Color& b = changeColor(c);
return 0;
}
But I really don't understand what you want to achieve with this.
S.
--
Stefan Naewe
stefan_DOT_naewe_AT_atlas_DOT_de