在下面的代码中,任何人都可以向我解释粗体的行是在做什么。指针算术和解引用
struct southParkRec { int stan[4]; int *kyle[4]; int **kenny; string cartman; }; int main() { southParkRec cartoon; cartoon.stan[1] = 4; cartoon.kyle[0] = cartoon.stan + 1; cartoon.kenny = &cartoon.kyle[2]; *(cartoon.kenny + 1) = cartoon.stan; //What does this line do? return 0; }
伙计,你从哪里得到这段代码? Cartman获得“臃肿”对象的任何原因:)? – Jacob 2010-06-23 20:18:31
我怀疑他在这里得到它:http://www.stanford.edu/class/cs106x/handouts/32-Section-Handout.pdf – fadden 2010-06-23 22:35:07