What does return mean in c language?

Guanhui
Release: 2020-06-18 17:13:01
Original
12007 people have browsed it

What does return mean in c language?

#What does return mean in c language?

return means to transfer the program flow from the called function to the calling function, and bring the value of the expression back to the calling function to realize the return of the function value. The return can be accompanied by a return value, as shown in The parameter specification after return, such as "return 123456", will return 123456 to the main function.

The meaning of return

In a function, if the return statement is encountered, the program will return to the next step of calling the function. One statement is executed, which means jumping out of the execution of the function and returning to the original place to continue execution. But if the return statement is encountered in the main function, the entire program will stop and exit the execution of the program.

The return value of the function is realized by the return statement return. The last operation performed by the function is return. The meaning of return is:

(1) The subroutine function returns to the calling function and declares When an execution of the function ends, the variable unit allocated during the call is revoked;

(2) Send the function value to the calling expression. Of course, this is not necessary because some functions have return values. Some functions have no return value.

return Function 1

means return. This program can be ended without parameters. If your member runs here, you will not run it further. , you can add a return statement and it will not be executed again.

return Function 2

Return the value of the specified type. When defining the function, there is not int af();int. Here is the return value, followed by return. This return value can be assigned to other variables after this function is executed, and its value is the value after return.

Recommended tutorials: "PHP" "C#"

The above is the detailed content of What does return mean in c language?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
c
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template