meili 发表于 2022-10-27 16:11:04

【Whatdoesthefollowingexampledo?voidsend(int*to,int*from,intcount){intn=(count+7)%8;switch(count%8){case0:do{*to++=*from++;case7:*to++=*from++;case6:*to++=*from++;case5:*to++=*from++;case4:*to++】

<p>问题:【Whatdoesthefollowingexampledo?voidsend(int*to,int*from,intcount){intn=(count+7)%8;switch(count%8){case0:do{*to++=*from++;case7:*to++=*from++;case6:*to++=*from++;case5:*to++=*from++;case4:*to++】
<p>答案:↓↓↓<p class="nav-title mt10" style="border-top:1px solid #ccc;padding-top: 10px;">刘炽昌的回答:<div class="content-b">网友采纳  主要目的是把从from开始拷贝数据到to.  拷贝数量是(((count+7)%8)-1)*8+(count%8)个元素.  第一次从count%8开始,依次执行casecount%8-1,casecount%8-2..到  case1,  然后循环n-1次,执行do{}中间的代码.
页: [1]
查看完整版本: 【Whatdoesthefollowingexampledo?voidsend(int*to,int*from,intcount){intn=(count+7)%8;switch(count%8){case0:do{*to++=*from++;case7:*to++=*from++;case6:*to++=*from++;case5:*to++=*from++;case4:*to++】