test.c:
int sum(int a, int b)
{
return (a+b);
}
test.pl:
# how do I call sum here?
test.c:
int sum(int a, int b)
{
return (a+b);
}
test.pl:
# how do I call sum here?
use Inline C => <<'__END_OF_C__';
int sum(int a, int b)
{
return (a+b);
}
__END_OF_C__
say sum($x,$y);
You'll need XS. It's quite involved, so it's best to look at the official manual and tutorial pages for it: