when i get the char* mem addr how can I convert char* to kj::ArrayPtr<const capnp::word> segment ?
在 2019年9月30日星期一 UTC+8上午4:26:27,Kenton Varda写道: > > Like this (broken into three lines with full types for illustrative > purposes): > > kj::ArrayPtr<const capnp::word> segment = segments[i]; > kj::ArrayPtr<const char> chars = segment.asChars(); > const char* ptr = chars.begin(); > size_t charCount = chars.size(); > > -Kenton > > On Sun, Sep 29, 2019 at 8:28 AM 张小 <[email protected] <javascript:>> wrote: > >> capnp::MallocMessageBuilder message; >> >> kj::ArrayPtr<const kj::ArrayPtr<const capnp::word>> >> segments = message.getSegmentsForOutput(); >> >> and I want get char* from segments how can i do ? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Cap'n Proto" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/capnproto/67493bb0-5396-4eb0-a5f8-5c05c8b9cd4c%40googlegroups.com >> >> <https://groups.google.com/d/msgid/capnproto/67493bb0-5396-4eb0-a5f8-5c05c8b9cd4c%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Cap'n Proto" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/57321b6f-ac8c-4c88-bdda-7c397055ee66%40googlegroups.com.
