views:

111

answers:

1

Using Managed C++ (VS 2005), how would you pass a array< unsigned char > to a function as a unsigned char*?

 ref class Utils
 {
     public: 

     static void A(array<unsigned char, 1> a)
     {
       //How do I call B()????
     }

     static void B(const unsigned char* a)
     {
        //do stuff
     }

 };
+1  A: 

Do you do it this way?

 void A(array<unsigned char, 1> a)
 {
     pin_ptr<unsigned char> pData= &a[0];
     B(pData);
 }
Adam Tegen