Search⌘ K
AI Features

How Functions Work?

Explore how functions work in D programming by learning the process of calling functions, producing return values, managing void functions, and choosing effective function names to write clearer code.

Calling a function

Starting a function so that it achieves its task is called calling a function. The function call syntax is the following:

function_name(parameter_values)

The actual values that are passed to functions are called function arguments. Although the terms parameter and argument are sometimes used interchangeably in the literature, they signify different concepts.

The arguments are matched to the parameters one by one in the order that the parameters are defined. For example, the last call of printMenu() in the ...