29. Reset Fault Buffer

Back To All Submissions
Previous Submission
Next Submission
#include <iostream>
using namespace std;

int main() {
    int code;
    cin >> code;
    int* err_code = new int ;
    delete(err_code);
    err_code = nullptr ;
    (!err_code) ? cout<<code<<" OK":cout<<code<<" NOT_OK";
    cout << "\n";
    return 0;
}

Solving Approach

 

 

 

 

 

Was this helpful?
Upvote
Downvote