- #1
- 4,652
- 38
I just finished writing a little recursive function in C++ and when my stopping condition is reached, I need it to do nothing. So the if statement looks funny:
if (the condition is met)
{
//do nothing
}
else
{
call yourself with smaller arguments
}
It works fine, but I feel uneasy about having absolutely nothing in the
if{} portion.
Is this bad programming style? Is it potentially dangerous?
Thanks!
if (the condition is met)
{
//do nothing
}
else
{
call yourself with smaller arguments
}
It works fine, but I feel uneasy about having absolutely nothing in the
if{} portion.
Is this bad programming style? Is it potentially dangerous?
Thanks!