Cpp exception handling

Sort by

recency

|

68 Discussions

|

  • + 0 comments

    Here is Cpp exception handling problem solution in - https://programmingoneonone.com/hackerrank-cpp-exception-handling-solution.html

  • + 0 comments

    This is so basic. Why is it medium?

  • + 0 comments
    void process_input(int n) {
          try {
            int d = largest_proper_divisor(n);
            cout << "result=" << d << endl;
        }
        catch (const invalid_argument& e) {
            cout << e.what() << endl;
        }
        cout << "returning control flow to caller" << endl;
    }
    
  • + 0 comments
    void process_input(int n) {
        try{
            int d = largest_proper_divisor(n);
            cout << "result=" << d << endl;
        }catch( invalid_argument& e){
            cout << e.what() << endl;
        }
        cout << "returning control flow to caller";
    }
    
  • + 0 comments

    Why is this considered "Medium" difficulty?