Nested function declarations
Andrej Mitrovic
andrej.mitrovich at gmail.com
Thu Jan 27 16:21:44 PST 2011
Well, you might be linking to an external function /and/ don't want
the function to be visible at module scope:
void main() {
extern(C) double func(); // linked from some C library..
double result = func();
}
You don't have to worry too much about your first example, it might
compile but it won't link:
import std.math: sqrt;
void main() {
double sqrt();
double result = sqrt();
}
Error 42: Symbol Undefined _D12externalTest4mainFZv4sqrtMFZd
--- errorlevel 1
More information about the Digitalmars-d-learn
mailing list