Convert C to Go
This page translates arbitrary C code to Go using
cxgo
.
#include <stdint.h> typedef struct { int x, y; } my_vec; my_vec vec_add(my_vec a, my_vec b) { my_vec c; c.x = a.x + b.x; c.y = a.y + b.y; return c; } my_vec vec_mul(my_vec a, float b) { my_vec c; c.x = a.x * b; c.y = a.y * b; return c; }
Powered by
gotranspile/cxgo
v0.4.1
and
modernc.org/cc
v3.41.0