I have this program and i'm having a very hard time understanding exactly how this function works and why does it do what it does. I think it has something to do with operation precedence, but i'm not really sure. Can anyone explain to me in steps how does this compile?
The program is this:
void s1( char dest[], char src[] )
{ int i = 0;
while( dest[i++] = src[i++] );
}
int main()
{
char a[100]="abcdef";
char b[100]="123456";
s1(a,b);
puts(a);
puts(b);
return 0;
}
The output is: 1b3d5f 123456
Thanks a lot.