Call a function: Difference between revisions

Content added Content deleted
Line 109: Line 109:
<lang awk>BEGIN {
<lang awk>BEGIN {
sayhello() # Call a function with no parameters in statement context
sayhello() # Call a function with no parameters in statement context
b=squareit(3) # Obtain the return value from a function with a single parameter in expressive context
b=squareit(3) # Obtain the return value from a function with a single parameter in first class context
}</lang>
}</lang>

In awk, scalar values are passed by value, but arrays are passed by reference.

The awk extraction and reporting language does not support the use of named parameters.


=={{header|C}}==
=={{header|C}}==