Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to convert QByteArray to BYTE*?
Posted
Updated 9-Mar-11 2:03am
v3

1 solution

You may use the data member for the purpose (though getting the buffer for write access is really a bad idea):

C++
QByteArray array;
//..
BYTE * pByte = reinterpret_cast<byte*>(array.data());
 
Share this answer
 
v2
Comments
Gokulnath007 9-Mar-11 8:17am    
Thank You.. Thats great.. myself 5 for it..
CPallini 9-Mar-11 8:26am    
Anyway, if you really need to write access the buffer, make a copy of it and modify the copy.
Sergey Alexandrovich Kryukov 9-Mar-11 15:18pm    
OK, 5, proposed as Answer.
--SA
CPallini 9-Mar-11 15:46pm    
Thank you. Now that we're good friends what about a debate about physics? On the serious side, how can you propose an answer (I'm not able to or, probably missing something...)?
Sergey Alexandrovich Kryukov 9-Mar-11 18:44pm    
Sorry, could you remind me..? What answer?
--SA

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