V
V
Vitaliy Vvitto2017-07-18 00:29:13
Programming
Vitaliy Vvitto, 2017-07-18 00:29:13

Why is it better to pass data through function parameters instead of working with them globally?

I have a C exam tomorrow, and I still can't think of a clear answer to the question why is it better to pass data to a function through parameters than to work with them through the global scope? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseniy Efremov, 2017-07-18
@vvitto

Because the use of parameters ensures the purity of functions, and therefore increases the modularity of the program, reusability, and in some cases even parallelization.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question