上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: Predict the output of following C++ program. 1 #include 2 using namespace std; 3 4 class A 5 { 6 // data members of A 7 public: 8 A () 9 { 10 cout a = a; 37 cout a = a;” in B’s constructor. The fourth line is printed by cout statement in B’s constructor. I... 阅读全文
posted @ 2013-11-27 16:14 虔诚的学习者 阅读(239) 评论(0) 推荐(0) 编辑
摘要: Predict the output of following C++ programs.Question 1 1 #include 2 using namespace std; 3 4 int fun(int a, int b = 1, int c =2) 5 { 6 return (a + b + c); 7 } 8 9 int main()10 {11 cout 2 using namespace std; 3 4 /* local variable is same as a member's name */ 5 class Test 6 { 7 pri... 阅读全文
posted @ 2013-11-27 16:09 虔诚的学习者 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Predict the output of following C++ programs.Question 1 1 #include 2 using namespace std; 3 4 class Point 5 { 6 private: 7 int x; 8 int y; 9 public:10 Point(const Point&p) 11 { 12 x = p.x; 13 y = p.y; 14 }15 void setX(int i) 16 {17 x = i;18 ... 阅读全文
posted @ 2013-11-27 16:03 虔诚的学习者 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Predict the output of following C++ programs.Question 1 1 #include 2 #include 3 using namespace std; 4 5 class String 6 { 7 char *p; 8 int len; 9 public:10 String(const char *a);11 };12 13 String::String(const char *a)14 {15 int length = strlen(a);16 p = new char[length +1];17... 阅读全文
posted @ 2013-11-27 15:56 虔诚的学习者 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Predict the output of following C++ programs.Question 1 1 template class Pair 2 { 3 private: 4 S x; 5 T y; 6 /* ... */ 7 }; 8 9 template class Element10 {11 private:12 S x;13 /* ... */14 };15 16 int main ()17 {18 Pair , Element> p;19 return 0;20 } Output: Compiler ... 阅读全文
posted @ 2013-11-27 15:49 虔诚的学习者 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Predict the output of following C++ programs.Question 1 1 #include 2 using namespace std; 3 4 class Test1 5 { 6 int x; 7 public: 8 void show() 9 { 10 }11 };12 13 class Test214 {15 int x;16 public:17 virtual void show() 18 { 19 }20 };21 22 int main(void)23 {24 ... 阅读全文
posted @ 2013-11-27 15:42 虔诚的学习者 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Predict the output of following C++ programs.Question 1 1 class Test1 2 { 3 int y; 4 }; 5 6 class Test2 7 { 8 int x; 9 Test1 t1;10 public:11 operator Test1() 12 { 13 return t1; 14 }15 operator int() 16 { 17 return x; 18 }19 };20 21 void fun ( ... 阅读全文
posted @ 2013-11-27 15:36 虔诚的学习者 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Predict the output of below C++ programs.Question 1 1 #include 2 3 using namespace std; 4 5 class Test 6 { 7 int value; 8 public: 9 Test (int v = 0) 10 {11 value = v;12 }13 int getValue() 14 { 15 return value; 16 }17 };18 19 int main() 20 {21 cons... 阅读全文
posted @ 2013-11-27 15:28 虔诚的学习者 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Difficulty Level: Rookie Predict the output of below C++ programs.Question 1 1 #include 2 using namespace std; 3 4 class Test 5 { 6 int value; 7 public: 8 Test(int v); 9 };10 11 Test::Test(int v) 12 {13 value = v;14 }15 16 int main() 17 {18 Test t[100];19 return 0;20 } Outp... 阅读全文
posted @ 2013-11-27 15:23 虔诚的学习者 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Difficulty Level: Rookie Predict the output of below C++ programs. Question 1 1 #include 2 using namespace std; 3 4 int x = 10; 5 void fun() 6 { 7 int x = 2; 8 { 9 int x = 1;10 cout 2 using namespace std; 3 4 class Point 5 { 6 private: 7 int x; 8 int y; 9 publ... 阅读全文
posted @ 2013-11-27 15:17 虔诚的学习者 阅读(181) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 11 下一页