locked
How to copy data from array<Byte>^ to char* ? RRS feed

  • Question

  • Hi i use vs2015 ent update3....

    How to copy data from C++/CLI  array<Byte>^  to char* in c/c++?

    thanks..

    Friday, July 7, 2017 5:24 PM

Answers

  • >How to copy data from C++/CLI  array<Byte>^  to char* in c/c++?

    You should be able to do something like this:

    Given: array<System::Byte>^ ba;

        pin_ptr<System::Byte> pp = &ba[0];
        char * pch = reinterpret_cast<char*>(pp);

    Dave

    • Marked as answer by d22xxxx Friday, July 7, 2017 8:34 PM
    Friday, July 7, 2017 7:37 PM

All replies

  • >How to copy data from C++/CLI  array<Byte>^  to char* in c/c++?

    You should be able to do something like this:

    Given: array<System::Byte>^ ba;

        pin_ptr<System::Byte> pp = &ba[0];
        char * pch = reinterpret_cast<char*>(pp);

    Dave

    • Marked as answer by d22xxxx Friday, July 7, 2017 8:34 PM
    Friday, July 7, 2017 7:37 PM
  • Thanks Dave!!!
    Friday, July 7, 2017 8:34 PM