FAQ
Hi all,

I have a C++ function which looks like this:
string magicdiff(const string &a, const string &b);

Since from a linking viewpoint, those strings will behave like ordinary C
structs (right?) and I am not using any other feature of C++ I am thinking
about calling this from Go via the C interface without using SWIG. (Simpler
tool chain, less maintenance, ...)

Has anyone done this before and can share their experience, example code,
or useful helper functions?

side note: in order to get something running quickly, I wrapped the
function in a pure C function which uses a small struct called "mystring"
containing a char* and a length. (I need the length, because the strings
are binary data and can contain \0.) But before using this approach more
widely, I want to check if there are already best practices established.

thanks!
Robert

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJul 28, '13 at 8:06a
activeJul 28, '13 at 8:06a
posts1
users1
websitegolang.org

1 user in discussion

Robert Jack Will: 1 post

People

Translate

site design / logo © 2022 Grokbase