-1
我想小结构数组中的所有元素复制到更大的结构数组没有从结构上我的代码如下将结构数组复制到另一个更大的结构数组而无需单独访问元素?
这个问题在这里copy smaller array into larger array问前先复制单个元素,但我找不到合适的reply.please帮助我
struct st
{
int i;
char ch[10];
};
int main()
{
struct st var[2]={1,"hello",2"bye"};
struct st largevar[3];
strcpy(largevar,var);// this is bad i guss but is there any way to copy without individual element access?
}
['memcpy'](http://linux.die.net/man/3/memcpy)? – IllusiveBrian 2014-11-05 16:44:19