C++ Interview Questions
Questions Answers Views Company eMail

What is Copy Constructor?

ABC, Siemens,

5 7822

What is an abstract class?


3 3539

What is the difference between creating an object, using 'new' and using 'malloc'?


2 4945

What is a virtual base class?


6 12812

What is OOPS and How it is different from Procedural Programming ?

Infosys, HP, Thyrocare,

23 46252

Difference between Top down and bottom up approaches for a given project ?

Siemens, Infosys, HCL, CSC, HP, IIT, BSNL,

14 78282

What and all can a compiler provides by default?

Accenture, HP,

3 6680

What are the different operators in C++?


3 9252

What is the difference between method and message?


4 24941

What is difference between initialization and assignment?

Infosys, HCL, HP,

12 33059

when can we use copy constructor?


6 10642

Describe functional overloading?


6 6113

Difference between Overloading and Overriding?

IBM, NIIT, GameLoft, HP, Appnetix Techno, Rohde and Schwarz,

35 161764

Difference between Operator overloading and Functional overloading?


10 36697

What is virtual constructor paradigm?


5 6977

Un-Answered Questions { C++ }

How to use CMutex, CSemaphore in VC++ MFC


i wanted to know about questions about c,c++ , which is required for placements.... im a fresher


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box


Write a program to reverse a string using recursive function?


what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?


What is debug class?what is trace class? What differences are between them? With examples.


Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A.Explain how a pointer to function can be declared in C++? B.List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header (“Include”) Files.


Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300”,”BullCart : 10”) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side


• What are the desirable attributes for memory managment?


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.


2. Give the different notations for the class.\


any one please tell me the purpose of operator overloading


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02


write a program to convert a decimal number in to its equivalent binary number?


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.