Record Detail

Compile Error

/in/exam3_matrix.cpp:8:45: error: return type specification for constructor invalid
 void intMatrix::intMatrix(int a,int b,int *c)
                                             ^
/in/exam3_matrix.cpp:8:6: error: prototype for 'intMatrix::intMatrix(int, int, int*)' does not match any in class 'intMatrix'
 void intMatrix::intMatrix(int a,int b,int *c)
      ^~~~~~~~~
In file included from /in/exam3_matrix.cpp:4:0:
/in/compile/exam3_matrix.h:27:2: error: candidates are: intMatrix::intMatrix(int, int, int)
  intMatrix(int r = 1 , int c = 1, int initialValue = 1); //TODO: Complete this construstor. 7Pts.
  ^~~~~~~~~
/in/compile/exam3_matrix.h:23:2: error:                 intMatrix::intMatrix(const intMatrix&)
  intMatrix(const intMatrix & that) {
  ^~~~~~~~~
/in/exam3_matrix.cpp:15:28: error: return type specification for destructor invalid
 void intMatrix::~intMatrix()
                            ^
/in/exam3_matrix.cpp: In member function 'int intMatrix::getElement(int, int)':
/in/exam3_matrix.cpp:43:9: error: ISO C++ forbids zero-size array 'a' [-Werror=pedantic]
  int a[0] = sizeof(rowNum)/sizeof(int);
         ^
/in/exam3_matrix.cpp:43:27: error: array must be initialized with a brace-enclosed initializer
  int a[0] = sizeof(rowNum)/sizeof(int);
                   ~~~~~~~~^~~~~~~~
/in/exam3_matrix.cpp:44:9: error: conflicting declaration 'int a [1]'
  int a[1] = sizeof(colNum)/sizeof(int);
         ^
/in/exam3_matrix.cpp:43:6: note: previous declaration as 'int a [0]'
  int a[0] = sizeof(rowNum)/sizeof(int);
      ^
/in/exam3_matrix.cpp:45:9: error: invalid conversion from 'int*' to 'int' [-fpermissive]
  return a;
         ^
/in/exam3_matrix.cpp:43:6: error: address of local variable 'a' returned [-Werror=return-local-addr]
  int a[0] = sizeof(rowNum)/sizeof(int);
      ^
/in/exam3_matrix.cpp: In member function 'void intMatrix::saveTo(std::__cxx11::string)':
/in/exam3_matrix.cpp:56:29: error: invalid types 'int[int]' for array subscript
    ofs << flatternArray[i][j];
                             ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Final Exam
Language
C++
Submit At
2022-08-02 15:36:42
Judged At
2022-08-06 15:13:20
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes