使用memcpy遇到一段代码 [英] Encountered piece of code using memcpy

查看:79
本文介绍了使用memcpy遇到一段代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这样的代码:



Hi, I encountered such code:

for(int i=0;i<count;i++)
{
...
CustomStruct obj;                memcpy(&obj,Variable[index].get_blob().data(sizeof(CustomStruct )*i),sizeof(CustomStruct ));

}





因为我在这里理解memcpy部分,基本上是在做CustomStruct数据结构的二进制副本(从索引sizeof(CustomStruct)* i)开始到obj变量吧?



as I understood memcpy part here, is basically doing a binary copy of CustomStruct data structures (starting at index sizeof(CustomStruct )*i) to the obj variable right?

推荐答案

是的,它只是做这样的二进制拷贝。
Yes, it is just doing such a binary copy.


这篇关于使用memcpy遇到一段代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆