-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