Skip to content
Snippets Groups Projects
Commit ad1a4d13 authored by Erik Löffler's avatar Erik Löffler
Browse files

added error messages

parent c693397c
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@
***********************************************************************************************************************/
#include "IntToFile.hpp"
#include <iostream>
/***********************************************************************************************************************
* public static function definitions
......@@ -23,11 +24,13 @@ void IntToFile::AppendInt(std::string filename, int num) {
// error opening file
if (file == nullptr) {
std::cerr << "Error occured while opening file. Possibly an unclosed file." << std::endl;
return;
}
// trigger pseudo error (negative numbers not allowed)
if (num < 0) {
std::cerr << "Error: no negative numbers allowed!" << std::endl;
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment