File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ namespace math {
46
46
*/
47
47
uint64_t iterativeFactorial (uint8_t n) {
48
48
if (n > 20 ) {
49
- throw new std::invalid_argument (" Maximum n value is 20" );
49
+ throw std::invalid_argument (" Maximum n value is 20" );
50
50
}
51
51
52
52
// 1 because it is the identity number of multiplication.
@@ -103,9 +103,9 @@ static void test() {
103
103
" Expected output: Exception thrown \n " ;
104
104
try {
105
105
math::iterativeFactorial (21 );
106
- } catch (std::invalid_argument* e) {
107
- std::cout << " Exception thrown successfully \n Content: " << e-> what ()
108
- << " \n " ;
106
+ } catch (const std::invalid_argument& e) {
107
+ std::cout << " Exception thrown successfully \n Content: " << e. what ()
108
+ << ' \n ' ;
109
109
}
110
110
111
111
std::cout << " All tests have passed successfully.\n " ;
You can’t perform that action at this time.
0 commit comments