Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC8.0
How to convert QByteArray to BYTE*?
Posted 8-Mar-11 23:48pm
Edited 9-Mar-11 3:03am
CPallini325.7K
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You may use the data member for the purpose (though getting the buffer for write access is really a bad idea):
 
QByteArray array;
//..
BYTE * pByte = reinterpret_cast<byte*>(array.data());
  Permalink  
v2
Comments
Gokulnath007 at 9-Mar-11 8:17am
   
Thank You.. Thats great.. myself 5 for it..
CPallini at 9-Mar-11 8:26am
   
Anyway, if you really need to write access the buffer, make a copy of it and modify the copy.
SAKryukov at 9-Mar-11 15:18pm
   
OK, 5, proposed as Answer.
--SA
CPallini at 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...)?
SAKryukov at 9-Mar-11 18:44pm
   
Sorry, could you remind me..? What answer?
--SA
CPallini at 10-Mar-11 1:43am
   
You wrote (3rd message above):"OK, 5, proposed as Answer". How did you 'propose'? I cannot find a way to (I'm probably missing something...).
SAKryukov at 10-Mar-11 1:51am
   
Yes, I understand, it's not clear. I used to ask such question myself. Somebody explain me that this is such a tradition. I think myself it does not really serve the purpose. OK, let me do it in my way... see my next comment...
--SA
CPallini at 10-Mar-11 2:47am
   
OK, I got it, thank you. :-)
SAKryukov at 10-Mar-11 1:52am
   
Gokulnath007,
I suggest you formally accept this Answer.
Thank you.
--SA

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

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 105
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 9 Mar 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100