主要目的是把從from開始拷貝數據到to.
拷貝數量是 ( ( ( count + 7 ) % 8 ) - 1 ) * 8 + ( count % 8 ) 個元素.
第一次從count%8開始,依次執(zhí)行 case count%8-1,case count%8-2 ..到
case 1,
然后循環(huán)n-1次,執(zhí)行 do {} 中間的代碼.
What does the following example do?
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
其他人氣:778 ℃時間:2020-07-06 23:31:47
優(yōu)質解答
我來回答
類似推薦
- what does the following code do?
- For what purpose does the author the bird example
- The following△、□、○each stands for a number.What does each stand for?的意思.
- what does parents do in the morning?是用does還是do?還是在parents前面加個you比較好?還是不用?
- 2.What maxis of the cooperative principle does the following dialogue flout?A:How do you like the film?B:Well,the music
- a little love這首歌所表達的意思是什么?
- 拋物線y=x平方-3x-10與x軸相交于點A和B 在x軸下方的拋物線上有一點P 設三角形ABP面積為S 則S最大值?
- they are all places of great interest.of great interest.為什么這么用,他在這里作什么作用.
- K為何值時,方程組
- 一種電腦,如果減少定價的百分之十出售,可盈利215元;如果減少定價的百分之二十,虧本125元.進價多少元
- 設函數f(x)=4sin(2x+1)-x,則f(x)的零點個數有幾個?
- 商場舉行促銷活動,某種洗衣機每臺按2400元出售獲利潤20%,如果按原來得標
猜你喜歡
- 1等我明白了什么是愛,你卻已離開(或者是 不在). 這句話翻譯成英文,優(yōu)美一點…
- 2歷史上除了諸葛亮外,還有誰“受任于敗軍之際,奉命于危難之間”?
- 3圓錐和圓柱半徑的比是3:2,體積的比是3:4,那么圓錐和圓柱高的比是_.
- 4長江起源于哪個省
- 5已知A={y/y=x的平方-4x+3,x∈R},B={y/y=x的平方-2x+2,x∈R},則A交集B等于( ).
- 6摩擦生熱的同時也起電了嗎?不是說摩擦生熱,也有摩擦起電嗎
- 7分子加5等于1/2,分母減3等于1/3求這個分數,要用二元二次方程
- 81_____is te second month of a year.2His b_____is october 3rd.空格應填什么?
- 9數列題:1/9,1,7,36下一個是什么?
- 10機械設計,現要設計一容器,容器中的溶劑,在工作時溫度保持在一定攝氏度
- 11衍射光柵中,如何將相鄰兩條光譜分的更開些
- 12小明學習了電學知識后,想知道家里有一臺電磁爐的電率,他利用了接在他家電路里的一個電能表來測量 除了電