+ 2
When is it worth to create function in C?
Is it a good practice to create function in C for every block of code that you need to evaluate more than once in your programm? Or maybe it is a wasting of memory and sometimes you can just copy some loops without creating function? I don't know how functions influence on the machine productivity.
3 ответов
+ 7
i'm choosing the functions. it's better for readability, scalability and if you call them with pointers you gain at memory usage in some scenarios.
+ 4
Yes, make a function whenever you might need to repeat the same block of code.
+ 2
Just two previous threads which can be referenced for the same query.
https://www.sololearn.com/Discuss/96352/?ref=app
https://www.sololearn.com/Discuss/1663409/?ref=app