Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to get an int* pointer to a address of a byte array. Now I want to cast the the int* to the type: pin_ptr<Byte>. Is there any way to do it?

C++
//Get the byte array
array<system::byte xmlns:system="#unknown">^ _ByteArray = GetByteArray();

//Try to get the pointer of byte array address, _pointer = 0x000000FF
int* _IntPointer = (int*)_ByteArray[0];

//The _BytePointer_ = 255 'ÿ'
pin_ptr<byte> _BytePointer_ = &_ByteArray[0];

//How to cast _IntPointer to pin_ptr<Byte> ???
Posted
Updated 8-Nov-14 12:10pm
v3

1 solution

 
Share this answer
 
Comments
Member 9857514 10-Nov-14 7:50am    
sorry, where chapter do you specify?
Richard MacCutchan 10-Nov-14 8:11am    
I didn't specify any chapter. That link is the starting point for you to read about arrays, and find out how to do what you want.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900