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]> 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].
> 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/CAJouXQnpa6bumg%3D%2Bv9dUrdqusMzAGqwjT%3D7ODVNViu4rfQHoyw%40mail.gmail.com.

Reply via email to