Function prototype: Difference between revisions
Content added Content deleted
m (→{{header|jq}}: Corrected syntax highlighting.) |
m (Incorrect description: changed from 'no arguments' to 'two arguments') |
||
Line 347: | Line 347: | ||
=={{header|D}}== |
=={{header|D}}== |
||
Beside function prototypes similar to the ones available in C (plus templates, D-style varargs), you can define class method prototypes in abstract classes and interfaces. The exact rules for this are best explained by the [//http://dlang.org/interface.html documentation] |
Beside function prototypes similar to the ones available in C (plus templates, D-style varargs), you can define class method prototypes in abstract classes and interfaces. The exact rules for this are best explained by the [//http://dlang.org/interface.html documentation] |
||
<syntaxhighlight lang="d"> |
<syntaxhighlight lang="d"> |
||
/// Declare a function with no arguments that returns an integer. |
|||
int noArgs(); |
int noArgs(); |
||
/// Declare a function with |
/// Declare a function with two arguments that returns an integer. |
||
int twoArgs(int a, int b); |
int twoArgs(int a, int b); |
||