首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

请教一下这段代码如何解释

2012-04-23 
请问一下这段代码怎么解释?char*temp,*temp1tempAdapterNametemp1AdapterNamewhile ((*temp!\0)||

请问一下这段代码怎么解释?
char*temp,*temp1;
  temp=AdapterName;
temp1=AdapterName;

while ((*temp!='\0')||(*(temp-1)!='\0'))
{
if (*temp=='\0') 
{
memcpy(AdapterList[i],temp1,temp-temp1);
temp1=temp+1;
i++;
}
temp++;
}
 
AdapterNum=i;
for (i=0;i<AdapterNum;i++)
printf("\n%d- %s\n",i+1,AdapterList[i]);
printf("\n");
其中的temp-temp1是指针相减?不会产生负值吗?
这段代码主要实现的是什么功能?
先谢谢了

[解决办法]
出现负值是从右向左拷贝

热点排行