Monday, 20 May 2013

Does a function that returns a constant work slower than a void function?

Does a function that returns a constant work slower than a void function?

Simplest example to highlight the difference:
int foo()
{
   doSomething();
   return 0;
}

void bar()
{
   doSomething();
   return;
}

int main()
{
   foo();
   bar();
}
Is bar faster than foo, and why?

No comments:

Post a Comment