Invalid array assignment

Hey,

i have a little problem and i have no clue what i am doing wrong :(

Following C++ Code (i can't show you the full application):
startLambdaSet = *CreateLambdaSet(randomSet.empty);

startLambdaSet:
1
2
 LambdaSetAT startLambdaSet, 
                    stopLambdaSet;


CreateLambdaSet:
1
2
3
4
5
6
7
8
9
10
11
12
 LambdaSetAT CreateLambdaSet(real32 value) 
    { 
        // generate random set for different labmdas 
        LambdaSetAT lambdaSet; 

        for(int LambdaIDX=0;LambdaIDX<MEAmaxWaveLen;LambdaIDX++) 
        { 
            lambdaSet[LambdaIDX] = value + 0.02 * static_cast<real32>(LIBRandom::Random()) * static_cast<real32>(LambdaIDX); 
        } 

        return lambdaSet; 
    }


LambdaSetAT:
typedef real32 LambdaSetAT[meadef::MEAmaxWaveLen];

real32:
typedef float real32;

while compiling i get the following error message: "invalid array assignment" but i can't see why because the return value of the function is from the same type as the variable...
Quick question while just reading through it:

if CreateLambdaSet function returns a LambdaSetAT and startLambdaSet is of type LambdaSetAt -
then this line is :
startLambdaSet = *CreateLambdaSet(randomSet.empty);
doesn't seem to make sense.
Shouldn't it be just;

startLambdaSet = CreateLambdaSet(randomSet.empty); //remove the * dereference opertor
Hmm...yeah...sorry...i am such an idiot...well, thanks ^^
Sometimes you just don't see the little things :S

Edit:

How ever, we still don't get it...now the error message
is incompatible typed in assignment of 'cycmea::real32 (*) [12]' to 'cycmea::real32 [12]'


According to my friend (i hate the qt compiler output) that means that the returned array has pointer as his content....now i really don't know anymore what's going on (yeah, i am a .NET dev and i don't work with C++ usually ;))

Edit2:
We now have a pointer in the parameters of CreateLambdaSet...problem solved...
Last edited on
Topic archived. No new replies allowed.