You are viewing a single comment's thread. Return to all comments →
Good practice would be to not assume such things, so your intuition is spot on. A simple check at the beginning of the function hurts nothing, as so...
int a, b;
cin >> a;
cin >> b;
if((b - a) < 0)
return 0; //or whatever other error handling is needed
you are right .