Record Detail

Compile Error

/in/exam3_matrix.cpp: In constructor 'intMatrix::intMatrix(int, int, int)':
/in/exam3_matrix.cpp:13:17: error: ISO C++ forbids variable length array 'matrix' [-Werror=vla]
  int matrix[m][n] = { 0 };
                 ^
/in/exam3_matrix.cpp:13:17: error: ISO C++ forbids variable length array 'matrix' [-Werror=vla]
/in/exam3_matrix.cpp: In destructor 'intMatrix::~intMatrix()':
/in/exam3_matrix.cpp:25:7: error: too few arguments to function 'void free(void*)'
  free();
       ^
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/ext/string_conversions.h:41,
                 from /usr/include/c++/7/bits/basic_string.h:6361,
                 from /usr/include/c++/7/string:52,
                 from /in/compile/exam3_matrix.h:4,
                 from /in/exam3_matrix.cpp:3:
/usr/include/stdlib.h:563:13: note: declared here
 extern void free (void *__ptr) __THROW;
             ^~~~
/in/exam3_matrix.cpp: In member function 'void intMatrix::fillFrom(std::vector<int>&)':
/in/exam3_matrix.cpp:43:23: error: 'n' was not declared in this scope
   for (int j = 0; j < n; j++)
                       ^
/in/exam3_matrix.cpp:45:24: error: 'm' was not declared in this scope
    for (int i = 0; i < m; i++)
                        ^
/in/exam3_matrix.cpp:45:24: note: suggested alternative: 'tm'
    for (int i = 0; i < m; i++)
                        ^
                        tm
/in/exam3_matrix.cpp:47:5: error: 'matrix' was not declared in this scope
     matrix[i][j] = source[num];
     ^~~~~~
/in/exam3_matrix.cpp:47:5: note: suggested alternative: 'atoi'
     matrix[i][j] = source[num];
     ^~~~~~
     atoi
/in/exam3_matrix.cpp: In member function 'int intMatrix::getElement(int, int)':
/in/exam3_matrix.cpp:56:8: error: 'matrix' was not declared in this scope
  num = matrix[rowNum][colNum];
        ^~~~~~
/in/exam3_matrix.cpp:56:8: note: suggested alternative: 'atoi'
  num = matrix[rowNum][colNum];
        ^~~~~~
        atoi
/in/exam3_matrix.cpp: In member function 'void intMatrix::saveTo(std::__cxx11::string)':
/in/exam3_matrix.cpp:60:36: error: unused parameter 'fileName' [-Werror=unused-parameter]
 void intMatrix::saveTo(std::string fileName)
                                    ^~~~~~~~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Final Exam
Language
C++
Submit At
2022-08-02 15:43:41
Judged At
2022-08-06 15:14:02
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes