0

Possible Duplicate:
How does Duff's device work?

I recently came across a question in C++ about the working of a C++ code...

 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);
   }
 }

How does this code falls into the loop if the value of count%8 comes to be other than 0 as it does not come across the do statement????

Community
  • 1
  • 1
bhuwansahni
  • 1,834
  • 1
  • 14
  • 20

0 Answers0