julia> cxx"""
#include <iostream>
class Hello {
public:
void hello_world(const char *now) {
std::string snow = now;
std::cout << "Hello, World! Now is " << snow << std::endl;
}
};
"""
true
julia> hello_class = @cxxnew Hello()
(class Hello *) @0x000000000726c190
julia> using Dates
julia> tstamp = string(Dates.now())
"2019-11-03T17:57:36.736"
julia> pointer(tstamp)
Ptr{UInt8} @0x00007f62dd088978
julia> @cxx hello_class->hello_world(pointer(tstamp))
Hello, World! Now is 2019-11-03T17:57:36.736
I do not quite get the very last line of code, i.e., @cxx hello_class->hello_world(pointer(tstamp))
. Why do we use pointer(tstamp) here? Any comments are greatly appreciated.