Question
The following C++ code has a compilation error. How can you correct it to properly use the abstract base class `Printer`? #include class Printer { public: virtual void print() = 0; }; class LaserPrinter : public Printer { public: void print() { std::cout << "Printing with LaserPrinter" << std::endl; } }; int main() { Printer* p = new LaserPrinter(); p->print(); delete p; return 0; }
More IT Operating System Questions
- In a bounded-buffer producer-consumer solution using counting semaphores 'full', 'empty', and a binary semaphore 'mutex', a buffer of size 8 currently hold...
- Which of the following statements about SRAM (Static RAM) is correct?
- Which of the following algorithm uses Darwinian based algorithm to find the best solutions to solve complicated problems with a greater number of variables...
- In REST/HTTP semantics, "safe" means a method causes no server-side state change, and "idempotent" means repeated identical requests always produce the sam...
- Linux uses a time-sharing algorithm ___________
- Round robin scheduling is essentially the preemptive version of
- Which layer is not in OSI but in TCP/IP
- Locality of Reference are of the following two types:
- What is the primary advantage of using recursion over iteration for certain problems (e.g., tree traversals)?
- In a digital communication system, let the encoding scheme be “Add 1 at the end of the bit stream if number of 1 bits is odd, else add 0 at the end of bit ...
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)