Function prototype: Difference between revisions

Content added Content deleted
m (→‎{{header|C sharp}}: Regularize header markup to recommended on category page)
Line 1,195: Line 1,195:


Ol functions is a first-class functions with dynamic arguments translation so no function prototypes is required.
Ol functions is a first-class functions with dynamic arguments translation so no function prototypes is required.

=={{header|OxygenBasic}}==
<lang>
'DECLARE FUNCTION' ABBREVIATED TO '!'

! f() ' a procedure with no params
! f(int a) ' with 1 int param
! f(int *a) ' with 1 int pointer param
! f(int a, int b, inc c) ' with 3 int params
! f(int a,b,c) ' compaction with 3 int params
! f(string s, int a,b) ' with 1 string and 2 int params
! f() as string ' function returning a string
! f(string s) as string ' with 1 string param
! *f(string s) as string ' as a function pointer: @f=address
! f(string s, optional i) ' with opptional param
! f(string s = "Hello") ' optional param with default value
! f(int n, ...) ' 1 specific param and varargs
! f(...) ' any params or none

'TRADITIONAL BASIC DECLARATIONS
declare sub f( s as string, i as long, j as long) ' byref by default
declare function f( byref s as string, byval i as long, byval j as long) as string

'C-STYLE DECLARATIONS
void f(string *s, long i, long j)
string f(string *s, long i, long j)



'BLOCK DIRECTIVES FOR FUNCTION PROTOTYPES:

extern ' shareable stdcall functions

extern lib "xyz.dll" ' for accessing functions in xyz Dynamic Link Library

extern export ' functions to be exported if this is a DLL

extern virtual ' for accssing interfaces and other virtual classes

end extern ' revert to internal function mode

</lang>


=={{header|PARI/GP}}==
=={{header|PARI/GP}}==