liveBook · Manning

Output parameter

Also called out parameter

An output parameter is a procedure or function parameter through which the called operation communicates a result to its caller separately from an ordinary return value.

How 2 Manning books explain it

100 C++ Mistakes and How to Avoid Them

An output parameter is a function parameter through which a function communicates a result by modifying caller-provided storage.

How it is used
Communicates multiple results from a function by modifying variables supplied by its caller.
How deep it goes
Explains reference-based modification and readability risks, then compares std::pair as an alternative.
Examples
Uses integer division to contrast returning a quotient and modifying a remainder variable with returning both in std::pair.
What you can do after
Evaluate output parameters against returning a std::pair when a function must produce two values.

Read how 100 C++ Mistakes and How to Avoid Them explains output parameter →

.NET in Action, Second Edition

An out parameter is a C# method parameter that the method must assign before returning and that provides an additional output value to the caller.

How it is used
Uses an out parameter to return rendered text and a Boolean result to signal whether a requested font was found.
How deep it goes
Defines assignment and caller requirements, then demonstrates a success-or-failure implementation; it does not explore broader language internals.
Examples
Demonstrates an ASCII-art renderer that returns rendered text or reports an invalid font.
What you can do after
Apply C# out parameters in an ASP.NET Core endpoint to return content on success and 404 on failure.

Read how .NET in Action, Second Edition explains output parameter →

Also covered in

What to know first

Related concepts

Questions about output parameter

What is output parameter?

An output parameter is a procedure or function parameter through which the called operation communicates a result to its caller separately from an ordinary return value.

Which Manning books explain output parameter?

100 C++ Mistakes and How to Avoid Them and .NET in Action, Second Edition.

What should I know before learning output parameter?

Manning books that teach output parameter usually introduce parameter first.

What is the difference between output parameter and class?

An output parameter is a procedure or function parameter through which the called operation communicates a result to its caller separately from an ordinary return value. A class is a programming-language construct that defines a type’s structure and behavior and provides a basis for creating or representing objects.

What is output parameter a kind of?

Output parameter is a kind of parameter. A parameter is a value or named input that specifies or influences the behavior, computation, or output of a function, model, or system.

What is output parameter part of?

Output parameter is part of argument passing. Argument passing is the mechanism by which values are supplied to a function's or procedure's parameters.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.