Hi All
I am programming a Black Jack. I made a procedure to calculate the Score of the Cards. Here is the code:

int calculatescore (int* spieler, int i0) //Der Score wird berechnet
{
    int ausgabe;
    int i1;
    int i2;
    for(i1=0; i1!=9; i1++)
    {
        if(spieler[i0][i1]!=0)
        {
            i2=spieler[i0][i1]%13;
            if(i2>=10)
            {
                ausgabe=ausgabe+10;
            }
            else if(i2==1)
            {
                ausgabe=ausgabe+11;
            }
            else
            {
                ausgabe=ausgabe+timer2;
            }
        }

    }
    return ausgabe;
}

When i compile the programm, i have the following Error:

subscripted value is neither array nor pointer

in line 8 and 10. Can you help me?

p.s. sorry for the bad english ;)

int* spieler indicates an array, not an array of arrays. I'd suggest that you change that to be int **spieler if you are, in fact, passing in a two-dimensional array. If you are not, then you can not index an int type with []. For type int *ip, the following returns an int: ip[x]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.