![]() |
![]() |
3670 | ![]() |
||||
![]() | |||||||
| Functions | |||||||
This function is directly recursive - i.e. it calls itself. Recursive functions can be dangerous because of their potential to cause stack-space overflow.
/*PRQA S 1278,2017,3120,3227,3408 ++*/
unsigned int fac(unsigned int n)
{
unsigned int ur = 1u;
if (n > 0u)
{
ur = n * fac(n - 1u); /* Message 3670 */
}
return ur;
}
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |