What does the following example do?
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/04/30 17:20:27
What does the following example do?
void send(int* to,int* from,int count)
{
int n=(count+7)%8;
switch(count%8)
{
case 0: do { *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to++ = *from++;
case 5: *to++ = *from++;
case 4: *to++ = *from++;
case 3: *to++ = *from++;
case 2: *to++ = *from++;
case 1: *to++ = *from++;
}while(--n>0);
}
}
//The C++ Programming Language (Third Edition) CH6 - 15
void send(int* to,int* from,int count)
{
int n=(count+7)%8;
switch(count%8)
{
case 0: do { *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to++ = *from++;
case 5: *to++ = *from++;
case 4: *to++ = *from++;
case 3: *to++ = *from++;
case 2: *to++ = *from++;
case 1: *to++ = *from++;
}while(--n>0);
}
}
//The C++ Programming Language (Third Edition) CH6 - 15
主要目的是把从from开始拷贝数据到to.
拷贝数量是 ( ( ( count + 7 ) % 8 ) - 1 ) * 8 + ( count % 8 ) 个元素.
第一次从count%8开始,依次执行 case count%8-1,case count%8-2 ..到
case 1,
然后循环n-1次,执行 do {} 中间的代码.
拷贝数量是 ( ( ( count + 7 ) % 8 ) - 1 ) * 8 + ( count % 8 ) 个元素.
第一次从count%8开始,依次执行 case count%8-1,case count%8-2 ..到
case 1,
然后循环n-1次,执行 do {} 中间的代码.
what does the following code do?
For what purpose does the author the bird example
2.What maxis of the cooperative principle does the following
“What does the writer do?
What does the writer do?
What does the man do?
"stuff",what does the word mean in these following sentences
what does "loss-loss situation" mean in the following senten
The following is what people do in some countries
What does the black cat do?
what does the meaning of karate-do
“what does the cleaner do every day?