Logo

Programming-Idioms

History of Idiom 190 > diff from v3 to v4

Edit summary for version 4 by phrank:
New C implementation by user [phrank]

Version 3

2019-09-27, 22:36:04

Version 4

2019-09-28, 12:25:15

Idiom #190 Call an external C function

Declare an external C function with the prototype

void foo(double *a, int n);

and call it, passing an array (or a list) of size 10 to a and 10 to n.

Use only standard features of your language.

Idiom #190 Call an external C function

Declare an external C function with the prototype

void foo(double *a, int n);

and call it, passing an array (or a list) of size 10 to a and 10 to n.

Use only standard features of your language.

Extra Keywords
C interoperability
Extra Keywords
C interoperability
Code
void foo(double *a, int n);
double a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
foo (a, 10);