10Fermer12
ProgValLe 31/08/2007 à 10:19
Si quelqu'un veut bien m'aider...

Voici mon code:
int main(int a;int b;short* mat1)
    {
    short mat2[a][b];
    int x;
    int y;
    x=1;
    for(x=1;a-x=0;x++)
        {
        for(y=1,b-y=0,y++
            {
            if (x>1)
                mat2[x][y] = mat2[x][y]+mat1[x-1][y];
            if (x<a)
                mat2[x][y] = mat2[x][y]+mat1[x+1][y];
            if (y>1)
                mat2[x][y] = mat2[x][y]+mat1[x][y-1];
            if (y<b)
                mat2[x][y] = mat2[x][y]+mat1[x][y+1];
            }
        }
    for x,1,a
        {
        for y,1,b
            {
            if (mat2[x][y]=2)
                {
                mat1[x][y] = 1;
                }
            else
                {
                mat1[x][y] = 0;
                }
            }
        }
        return mat1
    }


Voici les erreurs:
Type of 'a' defaults to 'int'.
Type of 'b' defaults to 'int'.
Type of 'mat1' defaults to 'int'.
Invalid lvalue in assignment.
Invalid lvalue in assignment.
Value computed is not used.
Value computed is not used.
Expected ';' before '{' token.
Expected expression before '}' token.
Expected expression before '}' token.
Expected expression before '}' token.
Expected '(' before 'x'.
Left-hand operand of comma expression has no effect.
Left-hand operand of comma expression has no effect.
Statement with no effect.
Unused variable 'mat2'.
Unused parameter 'mat1'.
Control reaches end of non-void function.


[Edit par Ximoon : suppression des [spoilers], [code] -> [pre]