Fehler bei einem Quellcode(c++) -------------------------- expected unqualified-id before ‘{’ token?

Grüßt euch,

ich versuche seit einigen Minuten einen Quellcode zu schreiben. Irgendwie bekomme ich immer diese Fehlermeldung: "expected unqualified-id before ‘{’ token" in Zeile 10.

Ich finde da aber kein Fehler!!! Kann mir jemand mit ein wenig Erfahrung sagen, was mir der compiler sagen will?

Vielen lieben Dank.

// Matrix.cpp
#include <iostream>
#include <ctime> // random numbers
using namespace std;
const int COLUMN = 5;  // number of columns has to be constant
const int MAXROW = 5;

//------------------- definition of functions -----------------------
void showMat(double a[][COLUMN], int r);  // COLUMN must be given
{
    for  (int i = 0, i < 0, i++)
{
    for (int j = 0, j < COLUMN; j++)
    {
         cout << a[j] [a] <<" ";
    }
cout << endl;
          }
}
//-----------------------------------------main() - function ---------------------------------------

int main()
{
                      srand(time (0));
                       int  r;

                      do
                      {
cout << " Geben Sie die gewünschte Anzahl der Zeilen an maximal 5." << endl;
cin >> r;
} while (r < 1 || r > MAXROW);

double MatrA [COLUMN] [MAXROW] ;
double MatrB [COLUMN] [MAXROW] ;
double MatrS [COLUMN] [MAXROW] ;
double MatrD [COLUMN] [MAXROW] ;

for  (int i = 0; i <  r;  i++)
{
    for  (int j = 0; j < COLUMN; j++)
    {
                    MatrA[j][i]  = rand() % 10;
                    MatrB[j][i]  = rand() % 10;
                   MatrS[j][i]  = MatrA[j][i] +  MatrA[j][i];
                  MatrD[j][i]  = MatrA[j][i]  -  MatrA[j][i];  
              }
}
cout << endl << "Matrix A:" << endl;
showMatr(MatrA, r);
cout << endl << "Matrix B:" << endl;
showMatr(MatrB, r);
cout << endl << " Additionsmatrix:"<< endl;
showMatr(MatrS, r);
cout << endl << " Differentmatrix:" << endl;
showMatr(MatrD, r);
cout << endl;
system ("Pause");
return 0;
}
Computer, Technik, programmieren, compiler, Cplusplus, CPP, Informatik, Quellcode

Meistgelesene Fragen zum Thema Quellcode