Call a function: Difference between revisions

→‎{{header|C}}: optional arguments, boo-yah
(→‎{{header|C}}: all talk, no code)
(→‎{{header|C}}: optional arguments, boo-yah)
Line 72:
int main()
{
op_arg(1001);
op_arg(1, 2);
op_arg(1, 2, 3);
return 0;
}
int op_arg(int a, int b)
{
printf("%d %d %d\n", a, b, (&b)[1]);
return a;
} /* end of sensible code */
Line 107 ⟶ 108:
 
/* Functions always pass by value. Pointers *sort of* work like references, though. */</lang>
 
=={{header|Icon}} and {{header|Unicon}}==
Icon and Unicon have generalized procedures and syntax that are used to implement functions, subroutines and generators.
Anonymous user