jeudi 20 juin 2019

Using Exception handling while dealing with inputs

I am learning about exception handling, but I am stuck at which practice to follow. Kindly Correct the sample code with proper programming practices and explain the benefits of each practice.

#include<iostream>
using namespace std;
int main()
{
    double a,b;
    cin>>a>>b;
    //Use Exception handling to deal when user enters say a string?
    <rest of the code>
}

Aucun commentaire:

Enregistrer un commentaire