mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
01f6aff422
Global variables (like functions) must be declared in the import "C" preamble and can then be used from Go.
12 lines
109 B
C
12 lines
109 B
C
#include "main.h"
|
|
|
|
int global = 3;
|
|
|
|
int fortytwo() {
|
|
return 42;
|
|
}
|
|
|
|
int add(int a, int b) {
|
|
return a + b;
|
|
}
|