Created
February 8, 2024 13:07
-
-
Save iTrooz/ccfd2cd5d4c1629ea69cf0d88d350556 to your computer and use it in GitHub Desktop.
Run C code from Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
#include <stdio.h> | |
static void foo() { | |
printf("Hello from C\n"); | |
} | |
*/ | |
import "C" | |
func main() { | |
C.foo() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment