RosettaCodeData/Task/Call-a-foreign-language-fun.../Perl/call-a-foreign-language-fun...

9 lines
170 B
Raku

use Inline C => q{
void c_hello (char *text) {
char *copy = strdup(text);
printf("Hello, %s!\n", copy);
free(copy);
}
};
c_hello 'world';