troubleshooting Question

memcpy vector to array in QT

Avatar of PeterVarain
PeterVarain asked on
11 Comments4 Solutions3859 ViewsLast Modified:
Hi everybody,

I have a small problem here... I need to copy the contents of a vector to a certain position in an array. However, memcpy returns the error "invalid conversion from int to void*"
Here's an example of what I'm trying to do:

QVector<qint16> Vector1(1024);
QVector<qint16> Vector2(1024);
QVector<qint16> Vector3(1024);

int HArr[1024][1024];

memcpy(HArr[0][0], &Vector1[0], 1024);
memcpy(HArr[0][1], &Vector2[0], 1024);
memcpy(HArr[0][2], &Vector3[0], 1024);

Can someone show me how to do this correctly ?


Join our community to see this answer!
Unlock 4 Answers and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros