Record Detail

Compile Error

/in/compound.cpp: In member function 'double Compound::calculateMolarMass()':
/in/compound.cpp:6:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^
/in/compound.cpp: In constructor 'Compound::Compound(int*, int)':
/in/compound.cpp:14:23: error: ISO C++ forbids variable length array 'inputarray' [-Werror=vla]
     int inputarray[num], rec;
                       ^
/in/compound.cpp:16:27: error: ISO C++ forbids variable length array 'elements' [-Werror=vla]
     string elements[elmnum];
                           ^
/in/compound.cpp:17:19: error: incompatible types in assignment of 'int' to 'int [num]'
     inputarray = *arr;
                   ^~~
/in/compound.cpp:22:32: error: invalid use of member function 'int Element::getAtomicNumber() const' (did you forget the '()' ?)
                 if (allElem[j].getAtomicNumber == inputarray[i]) {
                     ~~~~~~~~~~~^~~~~~~~~~~~~~~
/in/compound.cpp:23:46: error: invalid use of non-static member function 'std::__cxx11::string Element::getSymbol() const'
                     elements[p] = allElem[j].getSymbol;
                                              ^~~~~~~~~
In file included from /in/compound.cpp:2:0:
/in/compile/compound.h:18:16: note: declared here
         string getSymbol() const {return symbol;}
                ^~~~~~~~~
/in/compound.cpp:14:26: error: unused variable 'rec' [-Werror=unused-variable]
     int inputarray[num], rec;
                          ^~~
/in/compound.cpp: In member function 'std::__cxx11::string Compound::toString()':
/in/compound.cpp:32:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Final
Language
C++
Submit At
2024-08-08 11:39:36
Judged At
2024-08-13 14:41:39
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes