• Create Account

Posted 21 June 2013 - 09:57 AM

Stops you doing this

void CountDownFrom(int i)
{
while(i > 0)
{
cout << i-- << endl;
}
}


forcing you to copy the argument. Whether that is a good idea or not, I'll leave you to decide.

EDIT: OP should spend more time making member functions const-correct rather than concentrating solely on function arguments IMHO.

Posted 21 June 2013 - 09:54 AM

Stops you doing this

void CountDownFrom(int i)
{
while(i > 0)
{
cout << i-- << endl;
}
}


forcing you to copy the argument. Whether that is a good idea or not, I'll leave you to decide.

Posted 21 June 2013 - 09:53 AM

Stops you doing this

void CountDownFrom(int i)
{
while(i > 0)
{
cout << i-- << endl;
}
}


forcing you to copy the variable. Whether that is a good idea or not, I'll leave you to decide.

PARTNERS