Computer Science, asked by Rahan2450, 1 year ago

Why strlen is a good example for pure function?

Answers

Answered by Shailesh183816
0

\huge\boxed{\fcolorbox{red}{yellow}{Shailesh}}

A side-effect really means that the function keeps some sort of hidden state inside it. strlen is a good example of a pure function in C. If you call strlen with the same string, it always returns the same length. ... OCaml is therefore more practical because writing impure functions is sometimes useful.

\bf\huge\underline\red{Follow me}

Similar questions