Sunday, 15 September 2013

C++ memcpy: double incompatible with const void

C++ memcpy: double incompatible with const void

I have a private member
vector<double>m_data_content_joinfeatures;
and a struct:
struct udtJoinFeatures
{
double Values[16];
};
I would now like to copy some values from m_data_content_joinfeatures to a
struct of udtJoinFeatures like this:
void clsMapping::FeedJoinFeaturesFromMap(udtJoinFeatures &uJoinFeatures)
{
unsigned int iByteStartPos=1024; //where the data starts that I want
to copy
unsigned int iByteCount=128; //the number of bytes that I want to copy
memcpy(&uJoinFeatures[0],
m_data_content_joinfeatures[iByteStartPos],iByteCount);
}
But the compiler tells me that "double is not compatible with the
parameter of the kind void*".
Can somebody help? I don't want to use a for-next-statement to copy my
values over. I would like to use MemCpy if possible because I think it is
the fastest way.
Thank you!

No comments:

Post a Comment