摘要: 前两天参加了微软实习生招聘的笔试考试,其中有一道题很值得仔细推敲,在这里跟大家做个分享。话不多说,直接上代码,请大家仔细看一下其中的注释! 1 #include <iostream> 2 3 using namespace std; 4 5 class A 6 { 7 public: 8 int a; 9 };10 11 12 class B:public A13 {14 public:15 int b;16 };17 18 19 void setA(A *data, int i)20 {21 data[i].a = 2;22 ... 阅读全文
posted @ 2013-04-08 18:03 ITeed 阅读(406) 评论(0) 推荐(0) 编辑