Select the correct option to test your answer:
Computer
Object Oriented Programming In C Plus Plus
Difficulty: Medium
What will be the output of the following C++ code? #include<iostream> using namespace std; class Base { public: Base() { cout<<"Constructing Base \n"; } virtual~Base() { cout<<"Destructing Base \n"; } }; class Derived: public Base { public: Derived() { cout<<"Constructing Derived \n"; } ~Derived() { cout<<"Destructing Derived \n"; } }; int main(void) { Derived *d = new Derived(); Base *b = d; delete b; return 0; }
More Computer Questions
How are many number of characters available in newname.txt? #include <stdio.h> int main () { FILE * p; int n = 0; p = fopen ("newname.txt", "rb"); if (p == NULL) perror ("Error opening file"); else { while (fgetc(p) != EOF) { ++n; } if (feof(p)) { printf ("%d\n", n); } else puts ("End-of-File was not reached."); fclose (p); } return 0; }
What will be the output of the following C# code? static void Main(string[] args) { String a = "Ilove"; String b = "CSHARP"; b = string.Concat(a, ' ', b); Console.WriteLine(b); Console.ReadLine(); }
Which of the following sets the color of any text decoration, such as underlines, overlines, and strike throughs?
What is operator overloading in C++?
Which of these methods can be used to check whether the given value is a number or not?