RosettaCodeData/Task/Call-a-foreign-language-function/Perl/call-a-foreign-language-function-2.pl

9 lines
170 B
Perl
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
use Inline C => q{
void c_hello (char *text) {
char *copy = strdup(text);
printf("Hello, %s!\n", copy);
free(copy);
}
};
c_hello 'world';