All articles

Érdekes kód

Published 2007-04-25 - Last modified 2007-04-25

Fordul ez a kód? Csinál valamit?

[source:c++]
int c = 8;
char b[] = ” “;
char alma[] = “almaalma”;
char* a = alma;

switch (c % 8)
{
case 0: do { *b = *a++;
case 7: *b = *a++;
case 6: *b = *a++;
case 5: *b = *a++;
case 4: *b = *a++;
case 3: *b = *a++;
case 2: *b = *a++;
case 1: *b = *a++;
} while ((c -= 8) > 0);
}
[/source]