answersLogoWhite

0

How do you use return?

User Avatar

Anonymous

8y ago
Updated: 8/21/2019

In C/C++ programming and most other procedural languages, you use a return statement to return control to the calling function. In the case of the global main function, a returnstatement terminates the program, releasing all memory used by the program and returning control to the execution environment.

Functions that return void do not return a value and therefore do not require a return statement, unless the function needs to return early (before falling off the end of the function). Functions that return values must use a returnstatement to return the appropriate value to the caller.

In C++ (but not in C), the global main function does not require a return statement unless returning early. When omitted, the global main function implicitly returns the value 0 (to the execution environment) when execution falls off the end of the function. To return any other value, a return statement is required.

User Avatar

Wiki User

8y ago

What else can I help you with?

Related Questions

Can you use your foreign address on your tax return?

you can not use your foreign address an a tax return


Can I use FedEx to mail my tax return?

Yes, you can use FedEx to mail your tax return.


Can I use UPS to mail my tax return?

Yes, you can use UPS to mail your tax return.


Do you have to use a return address?

It is a good idea to use a return address when sending a letter. Oftentimes, the post office will not accept a letter that does not have a return address on it.


Is the grammar correct kindly return after use?

Kindly return after use. Please return after use. Both examples above seem to be correct grammar.


How do you use return function?

return;orreturn ;PS: not function, statement!


What is the use of return in function in c?

To return the exp. or const to the main fumction.


Why use void in main of java?

No. void is not a data type. It is mandatory for all java methods to return something and if it is not going to return anything, we have to mark the method with a "void" return type to let the JVM know that it must not expect anything from the method.


Can I return a used car to the dealership if it wasn't what I thought?

Can I return a use car


What is the use of return function in C programming?

To return the exp. or const to the main fumction.


What Movie titles have the word 'return' in it?

A lot of sequels use the word "return": Return of the Jedi, The Lord of the Rings: The Return of the King, The Return of the Living Dead, Return to Oz, Cocoon: The Return, Batman Returns, Return of the Seven, Return to the Blue Lagoon, Return to Witch Mountain. Here are a few non-sequels: Return to Me, Return to Paradise, Return of the Secaucus Seven, Point of No Return, River of No Return.


What is the formula to calculate the annual return based on the daily return of an investment?

To calculate the annual return based on the daily return of an investment, you can use the formula: Annual Return (1 Daily Return)365 - 1.