If we translate everything into one common style of using the subscript operator [] (possibly with & ) instead of a combination of * and + , it will look like this
cartoon.stan[1] = 4; cartoon.kyle[0] = &cartoon.stan[1]; cartoon.kenny = &cartoon.kyle[2]; cartoon.kenny[1] = &cartoon.stan[0];
After
cartoon.kenny = &cartoon.kyle[2];
you can think of kenny as an βarrayβ of int * elements embedded in the kyle array with 2 element offsets: kenny[0] equivalent to kyle[2] , kenny[1] equivalent to kyle[3] , kenny[2] equivalent to kyle[4] etc.
So when we do
cartoon.kenny[1] = &cartoon.stan[0];
this is equivalent to doing
cartoon.kyle[3] = &cartoon.stan[0];
This is basically what the last line does.
In other words, if we exclude kenny from consideration ("kill Kenny"), assuming that the rest of the code (if any) is independent of it, all your code will be equivalent
cartoon.stan[1] = 4; cartoon.kyle[0] = &cartoon.stan[1]; cartoon.kyle[3] = &cartoon.stan[0];
As for all this ... I have no idea.
source share