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

2023-07-01 11:58:00 -04:00
use Inline C => q{
void c_hello (char *text) {
char *copy = strdup(text);
printf("Hello, %s!\n", copy);
free(copy);
}
};
c_hello 'world';