
Global variables (like functions) must be declared in the import "C" preamble and can then be used from Go.
11 строки
109 Б
C
11 строки
109 Б
C
#include "main.h"
|
|
|
|
int global = 3;
|
|
|
|
int fortytwo() {
|
|
return 42;
|
|
}
|
|
|
|
int add(int a, int b) {
|
|
return a + b;
|
|
}
|