QuantumC uses the C ABI for external interoperability.
There are two directions:
To expose QuantumC functions to other languages through the C ABI:
extern:
int add(int a, int b) {
return a + b;
}
:extern
This is equivelant to
extern "C" {
int add(int a, int b) {
return a + b;
}
}
in many other languages.
To use functions provided by an external C ABI-compatible library or file:
foreign:
int add(int a, int b);
:foreign
This is like puting signatures in a extern "C" in other languages.