DEV Community

Discussion on: D and C++: Passing dynamic strings

Collapse
markboer profile image
Mark Boer

Hey @fxcqz , really good to see some C++ on dev.to :-)

I have read about the D langauge and should really give it a try. I was wondering though, is this the only way to pass strings from C++ to D. The function you wrote is mostly the C style of doing things, in C++ i would expect a signature like:

std::string numbers_upto(int n)

Do you really need the intermediate char* for it to work?

Collapse
eljayadobe profile image
Eljay-Adobe

C is the common ABI ... the lingua franca between C++ and D. (And the lingua franca between many otherwise incompatible compiled programmings languages.)

If you want to give D a try, you can use dmd (Digital Mars), gdc (GNU GCC family), or ldc2 (LLVM family) compilers. q.v. D compilers