我正在尝试做一个简单的 memcpy,如下所示。
char *token[32];
char *temp_store[4];
for (i = 0 ; i < 4; i++)
{
memcpy(token[4+i],temp_store[i],strlen(temp_store[i]));
}
我在令牌数组中有以下值。
temp_store[0] = "5";
temp_store[1] = "6";
temp_store[2] = "7";
temp_store[3] = "8";
我希望将这 4 个值分别"5" , "6", "7", "8"
复制到token[4],token[5],token[6] and token[7]
。
但是,出于某种原因,我没有在 token[] 中获得这些值。我不知道为什么会这样。