add foobar() example to Function/Procedure section showing var parameters

This commit is contained in:
jlp765 2016-09-05 20:49:36 +10:00
parent 736968ffe2
commit f616d27fde
1 changed files with 9 additions and 1 deletions

View File

@ -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>