Click here to Skip to main content
11,721,385 members (84,574 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VC8.0
How to convert QByteArray to BYTE*?
Posted 8-Mar-11 22:48pm
Edited 9-Mar-11 2:03am

1 solution

Rate this: bad
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*>(;
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.
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?
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...
CPallini at 10-Mar-11 2:47am
OK, I got it, thank you. :-)
SAKryukov at 10-Mar-11 1:52am
I suggest you formally accept this Answer.
Thank you.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 510
1 OriginalGriff 249
2 Mika Wendelius 170
3 F-ES Sitecore 80
4 cyycoish 70
0 Sergey Alexandrovich Kryukov 2,209
1 OriginalGriff 969
2 F-ES Sitecore 660
3 Maciej Los 609
4 Richard MacCutchan 560

Advertise | Privacy | Mobile
Web02 | 2.8.150901.1 | Last Updated 9 Mar 2011
Copyright © CodeProject, 1999-2015
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