This is a small part of main.cpp:
int main(int argc, char *argv[]){
int playerNum = atoi(argv[1]);
int courtSize = atoi(argv[2]);
int refereePresent = atoi(argv[3]);
vector<pthread_t> allThreads;
try {
court = new Court(courtSize, refereePresent);
} catch (const std::exception& e) {
// Catch all exceptions derived from std::exception
printf("Exception caught: %sn", e.what());
return 0;
}
It takes args and makes an instance from Court class. The header file containing the Court class needs to throw exception whenever there is not enough arguments (both). How do I check whether they are absent, it does not return 0 or anything. Empty constructor also does not work.