-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (29 loc) · 718 Bytes
/
main.cpp
File metadata and controls
44 lines (29 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "src/MAIN.hpp"
#include <vector>
#include <iostream>
// Main function
int main(int argc, char * argv[]) {
// argc: number of arguments
// argv: vector of arguments
// Try to...
try {
// Run the program
doMain();
// Exit
return 0;
}
catch (const std::exception& err) {
// Catch exceptions
std::cerr << "Exception: " << err.what() << '\n';
}
catch (const char* err) {
// Catch error messages
std::cerr << "Exception: " << err << '\n';
}
catch (...) {
// Or unknown errors
std::cerr << "Unknown Exception\n";
}
// Return failure flag if got here
return 1;
}