to ignore the additional if (randvar >=3) //{do stuff} line and just continue the code, (particularly if the continued code is exactly what the randvar result would want to do if it was 3 or more. )
Thanks for any clarification on this.( Not sure of the correct terminology above).
#include <iostream>
#include <ctime>
using namespace std;
int otherFunc (int randvar)
{
// do whatever
return 0;
}
int main ()
{
srand (time (NULL));
int randvar = (rand()%10+1);
if (randvar <= 2) { otherFunc (randvar);}
cout<<" do other stuff ignoring if (randvar >=3) {// }" <<endl;
cin.ignore().get();
return 0;
}


Sign In
Create Account


Back to top









