F
F
FireShip2016-11-11 22:50:07
go
FireShip, 2016-11-11 22:50:07

Is it possible to send a slice from go to c++?

In a program written in go, there is a slice made with make() ( it seems slice ). I guess it's just not possible to send it to c++ via sockets and use it there as an array. Actually the question is, is it possible to implement it somehow?
I have an idea to use the "C" library in Go, but will it be possible to work with an array created with it in the same way as with a Go slice? Or are there completely similar functions? Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FireShip, 2016-11-11
@FireShip

Actually, I decided not to complicate things. I will need to send multiple lines, so I'll just concatenate them into one line, where I will separate everything necessary with a colon, for example, and I will already parse it from C code. Thanks to all.

A
Alexander Pavlyuk, 2016-11-11
@pav5000

To call cish code from Go, there is cgo https://blog.golang.org/c-go-cgo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question