/*Calling external pascal functions in C (from pascalfunc.p) */ /* see also Makepascalextern, pascalfunc.p and externpascal.g */ /*this example also demonstrates how to pass variables. It is based upon the Borland notion of units */ #include #include #include "externpascal.h" /*contains extern statement */ #include int main (int argc, char* *argv, char* *envp) { int i; init_Foo(); _p_initialize (argc,argv,envp); Helloworld(); Hello(&i); printf("I = %i\n",i); _p_finalize (); } /*note C can only pass variable by value i.e. the function internally contains a copy of the variable. To pass by reference you have to use pointers as in this example */