add foobar() example to Function/Procedure section showing var parameters
This commit is contained in:
parent
736968ffe2
commit
f616d27fde
|
@ -240,6 +240,10 @@ int bar() {
|
|||
int baz(int x) {
|
||||
return x*2;
|
||||
}
|
||||
int foobar(int *x) {
|
||||
return (++*x)*2;
|
||||
}
|
||||
|
||||
</pre>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -250,8 +254,12 @@ proc foo() =
|
|||
proc bar(): int =
|
||||
2
|
||||
|
||||
proc baz(x: int) =
|
||||
proc baz(x: int): int =
|
||||
x*2
|
||||
|
||||
proc foobar(x: var int): int =
|
||||
inc(x)
|
||||
result = x*2 # also valid
|
||||
</pre>
|
||||
</td>
|
||||
<td><b>Function/Procedure.</b> </td>
|
||||
|
|
Loading…
Reference in New Issue