Why strlen is a good example for pure function?
Answers
Answered by
0
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.
Similar questions