I
I
IslamuMilana2020-12-26 10:36:58
Programming
IslamuMilana, 2020-12-26 10:36:58

Returning values?

What does it mean to return values?

For example, there is a function with void and it does not return a value, but in the body of the function there are operators that return something ... How to understand this?
The same alert in JS, for example, does not return a value, but it also outputs a string to the browser...

My brain with 0.001 iq does not want to understand... Please explain

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-12-26
@IslamuMilana

The return value is a write to a special area of ​​memory at the end of the function. There are functions that work with pointers - they immediately write data to the memory area assigned to the variable. Such functions can be void.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question