Здравствуйте. Не получается заставить работать. Получаю ошибки:
project_two.cpp:5:44: error: ‘sizeMatrix’ was not declared in this scope
void fillingAndShowElementsMatrix (int m[][sizeMatrix], int sm);
^
project_two.cpp:5:55: error: expected ‘)’ before ‘,’ token
void fillingAndShowElementsMatrix (int m[][sizeMatrix], int sm);
^
project_two.cpp:5:57: error: expected unqualified-id before ‘int’
void fillingAndShowElementsMatrix (int m[][sizeMatrix], int sm);
^
project_two.cpp:18:44: error: ‘sizeMatrix’ was not declared in this scope
void fillingAndShowElementsMatrix (int m[][sizeMatrix], int sm){
^
project_two.cpp:18:55: error: expected ‘)’ before ‘,’ token
void fillingAndShowElementsMatrix (int m[][sizeMatrix], int sm){
^
project_two.cpp:18:57: error: expected unqualified-id before ‘int’
void fillingAndShowElementsMatrix (int m[][sizeMatrix], int sm){
^
Вот код:
#include <iostream>
#include <cstdlib>
using namespace std;
void fillingAndShowElementsMatrix (int m[][sizeMatrix], int sm);
int main (void){
const int sizeMatrix = 10;
int matrix[sizeMatrix][sizeMatrix];
int minElementMatrix = 0;
int maxElementMatrix = 0;
fillingAndShowElementsMatrix (matrix, sizeMatrix);
return 0;
}
void fillingAndShowElementsMatrix (int m[][sizeMatrix], int sm){
for (int i = 0; i < sm; i++){
for (int j = 0; j < sm; j++){
m[i][j] = rand () % 31 + 30;
cout << m[i][j] << endl;
}
}
}