Stack Exchange
expected primary-expression before '[' token
I'm trying to create a function which generates a Color-Code without doubles. My attempt:
        int random(int lowerbounds, int upperbounds)
        {
            return lowerbounds + rand() % (upperbounds - lowerbounds + 1);
        }

        enum Farbe { Red, Orange, Grey, Blue, Grey, White, Purple };
        bool err;
        int zahl;
        Farbe Code[];
        while(err)
        {
            for(int i = 0; i < 4; i++)
            {
                zahl = 0;
                zahl = random(1, 7);
                switch (zahl) {
                case 1:
                    Code[i] = Red;
                    break;
                case 2:
                    Code[i] = Orange;
                    break;
                case 3:
                    Code[i] = Grey;
                    break;
                case 4:
                    Code[i] = Blue;
                    break;
                case 5:
                    Code[i] = Green;
                    break;
                case 6:
                    Code[i] = White;
                    break;
                case 7:
                    Code[i] = Purple;
                    break;
                }
            }
            for(int i = 0; i < 3; i++)
            {
                for(int j = 0; j < 3; j++)
                {
                    if(i != j)
                    {
                        if(Farbe[i] == Farbe[j]) // here is the Error
                        {
                            err = true;
                        }
                    }
                }
            }

        }

But the compiler always returns the error
...cpp:72: error: expected primary-expression before '[' token

and
...cpp:72: error: expected primary-expression before ']' token

I think it's a pretty simple algorithm, but I have no idea for solve.
Any help? 

did you mean Code instead of Farbe on the line that causes the error ?

@SanderDeDycker: Ohh, I'm blind: Would you post a answer so a I can accept it.

Did you not get an error on the line Farbe Code[];? And on the duplicate Grey in the declaration of enum Farbe? Please compile your code before you post it.

if(Farbe[i] == Farbe[j]) // here is the Error
{
err = true;
}

Farbe is an enum type, not an array variable.
You must be referring to the vriable code of type Farbe

It looks like you used Farbe instead of Code in the line that generates the error. It should read :
if(Code[i] == Code[j])

