+ 1
How can we differentiate pure and normal function?
2 Réponses
+ 3
We can have pure void functions but only pretty silly ones. There are two in total:
void do_nothing() {
}
void crash() {
while(true) { }
}
+ 2
Pure function has not side effects.pure functions return value depend on given parameters and memory. And important thing is pure functions have strong return type..it can't have return type like "void".