C++报错:
main.cpp:607: error: no matching function for call to ‘std::exception::exception(const char [15])’, throw std::exception(“Invalid input.”);
将原来的
throw std::exception("Invalid input.");
修改为
std::logic_error e("Invalid input.");
throw std::exception(e);
并添加头文件
#include <iostream>
#include <stdexcept>
using namespace std;