Anonymous user
Use another language to call a function: Difference between revisions
Use another language to call a function (view source)
Revision as of 06:06, 3 July 2016
, 7 years ago→{{header|PARI/GP}}
Line 792:
}</lang>
Compile interface to a library: ''gcc -O2 -Wall -fPIC -shared query.c -o libquery.so -lpari''
Compile main() C code from above and link against this library: ''gcc -O2 -Wall main.c -o main -L. libquery.so
Start main(): ''LD_LIBRARY_PATH=. ./main''
PARI solves the ROT13 encrypted message and returns result to caller.
Output:<pre>Here I am</pre>
NB. It's also possible to compile both files together without building an interface: ''gcc -O2 -Wall main.c query.c -o main2 -lpari''
''./main2'' yields same output as stated above.
=={{header|Pascal}}==
|