answersLogoWhite

0

The only limitation is that the object returned from a function must be returned by value. We may return a pointer (by value) in order to return complex objects more efficiently, however the pointer must not refer to a non-static local object because non-static local objects fall from scope as soon as the function returns.

In C++ we do not have this problem because objects can be implemented with efficient move semantics, thus passing by value becomes an efficient means of returning complex objects from functions, including non-static local objects.

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

What are limitations of c language?

c does not support runtime checkingchecking what?


What is return statement under function in turbo C?

return 0


What are the examples of return c language?

return; return -1; return NULL;


What is a statement in c language programme?

Any experssion including assignment or a function call can be a statement in C


What is statement terminator in c language?

The compiler demands it: your programs wouldn't compile without them.


What is if-statement in c programming language?

One of the statements, obviously.


What is executable statement of c language?

anything ending in semicolon/;


What is else if in C programming language?

Statements. Typical usage: if (<condition>) <statement>; else <statement>;


What are the limitations of switch statement in c?

For Answer Contact Jagit Singh Sardar ( Fudua da Sardar) 9815078589


How does the compiler differentiate the statement and function in C programming?

statement should not return a value but function returns a value


Which symbol is used as a statement terminator in C?

semicolon ';' (Not applicable for block-statements)


How do you use return?

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.