HOME
Report Broken Links
ONLINE FORUM
INTERVIEW QUESTIONS

QUESTIONS
Computer Science
Database
Java Technologies
Microsoft Technologies
C and C++
Programming
Networking
Software Development
Aptitude
Operating Systems
Companies
COLLEGE PHOTO

FastCounter by bCentral
 
C++ Basic Questions 3
1. Why would you use: public/private/protected inheritance?
2. Why does the language not define static virtual functions
3. Can you make a destructor virtual?
4. Why would you want a virtual destructor?
5. How would you print the first 10 characters of a string?
6. When would you use private inheritance?
7. How and why would you implement a '<<' operator for a String class?
8. When would you use a reference?
9. Why do you want to have virtual member functions? How was "it" done before vmf's came into existence? What was wrong with it?
10. Why is protected" as bad as ""public""?"
11. Give one example use of a static member.
12. Why did new (a new expression) have to be a language-level construct while malloc could be a library function?
13. What are the advantages and disadvantages of templates over plain old inheritance and heterogenous containers?
14. What are the problems with a tree-style hierarchy?
15. Why is iostream better than stdio? (There are umpteen reasons, I'm just talking about the type-safe answer...)
16. Why would someone want to have RTTI when there are virtual functions? Doesn't that sound contradicting in purpose? Discuss one situation where RTTI could be useful, if you think so.
17. Aren't templates glorified macros?
18. If you know exceptions, aren't you worried that they could turn out to be the modern "goto"? Why isn't it that bad in C++?
19. I would settle for "Why use const instead of #define?" as a question.
20. What's the difference between a declaration and a definition?
21. What's the difference between a struct and a class?
22. Describe for me in 100 words or less how to simulate a virtual table using C.
23. What is the difference between delete[] and delete?
24. I need to write Wombat objects to an ostream. Describe two ways to accomplish this and one way that won't work.
25. What's an initializer list?
26. Can you think of a 5 letter word to describe the following?

class {
int n;
public:
void setN(int);
int getN() const;
};
(One possible answer: "struct"...)
27. describe how you extend stdio to access streams that the original implementation never heard of (socket stream, etc.).
28. describe how you extend printf to support a new (user defined) type.
ONLINE FORUM
Google
  Web dhruvaraj.com   
Online Books
General
Computer Science
Database Books
Hardware Books
Java Books
Languages
Microsoft Books
Operating Systems
Medical Books
Networking
Software Engineering
BUY BOOKS
Computers Internet
Home Office
Apple
Business Culture
Certification Central
Computer Science
Databases
Digital Music Computer Audio
Games Strategy Guides
Graphic Design
Hardware
Microsoft
Networking
Operating Systems
Programming
Software
Web Development
Authors, A-Z
By Publisher
General
 
Diseases:A B C D E F G H I J K L M N O P Q R S T U V W X Y Z