したがって、リンクされたリストのクラス例外を実行していますが、何を入れればよいかわかりません。たとえば、ユーザーがリストに存在しない要素を削除したい場合、「Sparse Exception catch 」と出力されます。 : 要素が見つかりません、削除に失敗しました」または「スパース例外がキャッチされました: スパース行列が空で、印刷に失敗しました」。このままでいいのかな?もしそうなら、どうすればメッセージを印刷できますか?
SparseException::SparseException ()
{
}
SparseException::SparseException (char *message)
{
if (strcmp(message, "delete"))
cout << "Sparse Exception caught: Element not found, delete fail";
else
cout << "Sparse Exception caught: sparse matrix empty, printing failed";
}
void SparseException::printMessage () const
{
}