Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
C++ Question

C++ Question

Ratings: (0)|Views: 211 |Likes:
Published by api-3827976

More info:

Published by: api-3827976 on Oct 18, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





Page 1
C++ Question
PART02 -- Environmental/managerial issues

Q1: What is C++? What is OOP?
Q2: What are some advantages of C++?
Q3: Who uses C++?
Q4: Does C++ run on machine `X' running operating system `Y'?
Q5: What C++ compilers are available?
Q6: Is there a translator that turns C++ code into C code?
Q7: Are there any C++ standardization efforts underway?
Q8: Where can I ftp a copy of the latest ANSI-C++ draft standard?
Q9: Is C++ backward compatible with ANSI-C?
Q10: What books are available for C++?
Q11: How long does it take to learn C++?

PART03 -- Basics of the paradigm

Q12: What is a class?
Q13: What is an object?
Q14: What is a reference?
Q15: What happens if you assign to a reference?
Q16: How can you reseat a reference to make it refer to a different
Q17: When should I use references, and when should I use pointers?
Q18: What are inline fns? What are their advantages? How are they

PART04 -- Constructors and destructors
Q19: What is a constructor? Why would I ever use one?
Q20: What are destructors really for? Why would I ever use them?
PART05 -- Operator overloading

Q21: What is operator overloading?
Q22: What operators can/cannot be overloaded?
Q23: Can I create a `**' operator for `to-the-power-of' operations?

PART06 -- Friends

Q24: What is a `friend'?
Q25: Do `friends' violate encapsulation?
Q26: What are some advantages/disadvantages of using friends?
Q27: What does it mean that `friendship is neither inherited nor
Q28: When would I use a member function as opposed to a friend function?

PART07 -- Input/output via and

Q29: How can I provide printing for a `class X'?
Q30: Why should I use instead of the traditional ?
Q31: Printf/scanf weren't broken; why `fix' them with ugly shift

PART08 -- Freestore management

Q32: Does `delete ptr' delete the ptr or the pointed-to-data?
Q33: Can I free() ptrs alloc'd with `new' or `delete' ptrs alloc'd w/
Q34: Why should I use `new' instead of trustworthy old malloc()?
Q35: Why doesn't C++ have a `realloc()' along with `new' and `delete'?
Q36: How do I allocate / unallocate an array of things?
Q37: What if I forget the `[]' when `delete'ing array allocated via
`new X[n]'?
Q38: What's the best way to create a `#define macro' for `NULL' in C++?

Page 2
C++ Question
PART09 -- Debugging and error handling
Q39: How can I handle a constructor that fails?
Q40: How can I compile-out my debugging print statements?
PART10 -- Const correctness

Q41: What is `const correctness'?
Q42: Is `const correctness' a good goal?
Q43: Is `const correctness' tedious?
Q44: Should I try to get things const correct `sooner' or `later'?
Q45: What is a `const member function'?
Q46: What is an `inspector'? What is a `mutator'?
Q47: What is `casting away const in an inspector' and why is it legal?
Q48: But doesn't `cast away const' mean lost optimization opportunities?

PART11 -- Inheritance

Q49: What is inheritance?
Q50: Ok, ok, but what is inheritance?
Q51: How do you express inheritance in C++?
Q52: What is `incremental programming'?
Q53: Should I pointer-cast from a derived class to its base class?
Q54: Derived* --> Base* works ok; why doesn't Derived** --> Base** work?
Q55: Does array-of-Derived is-NOT-a-kind-of array-of-Base mean arrays
are bad?

Inheritance -- virtual functions
Q56: What is a `virtual member function'?
Q57: What is dynamic dispatch? Static dispatch?
Q58: Can I override a non-virtual fn?
Q59: Why do I get the warning "Derived::foo(int) hides
Base::foo(double)" ?

Inheritance -- conformance
Q60: Can I `revoke' or `hide' public member fns inherited from my base
Q61: Is a `Circle' a kind-of an `Ellipse'?
Q62: Are there other options to the `Circle is/isnot kind-of Ellipse'

Inheritance -- access rules
Q63: Why can't I access `private' things in a base class from a derived
Q64: What's the difference between `public:', `private:', and
Q65: How can I protect subclasses from breaking when I change internal

Inheritance -- constructors and destructors
Q66: Why does base ctor get *base*'s virtual fn instead of the derived
Q67: Does a derived class dtor need to explicitly call the base

Inheritance -- private and protected inheritance
Q68: How do you express `private inheritance'?
Q69: How are `private derivation' and `containment' similar? dissimilar?

Page 3
C++ Question

Q70: Should I pointer-cast from a `privately' derived class to its base
Q71: Should I pointer-cast from a `protected' derived class to its base
Q72: What are the access rules with `private' and `protected'
Q73: Do most C++ programmers use containment or private inheritance?

PART12 -- Abstraction

Q74: What's the big deal of separating interface from implementation?
Q75: How do I separate interface from implementation in C++ (like
Q76: What is an ABC (`abstract base class')?
Q77: What is a `pure virtual' member function?
Q78: How can I provide printing for an entire hierarchy rooted at
`class X'?
Q79: What is a `virtual destructor'?
Q80: What is a `virtual constructor'?

PART13 -- Style guidelines

Q81: What are some good C++ coding standards?
Q82: Are coding standards necessary? sufficient?
Q83: Should our organization determine coding standards from our C
Q84: Should I declare locals in the middle of a fn or at the top?
Q85: What source-file-name convention is best? `foo.C'? `foo.cc'?
Q86: What header-file-name convention is best? `foo.H'? `foo.hh'?
Q87: Are there any lint-like guidelines for C++?

PART14 -- C++/Smalltalk differences and keys to learning C++

Q88: Why does C++'s FAQ have a section on Smalltalk? Is this Smalltalk-
Q89: What's the difference between C++ and Smalltalk?
Q90: What is `static typing', and how is it similar/dissimilar to
Q91: Which is a better fit for C++: `static typing' or `dynamic typing'?
Q92: How can you tell if you have a dynamically typed C++ class library?
Q93: Will `standard C++' include any dynamic typing primitives?
Q94: How do you use inheritance in C++, and is that different from
Q95: What are the practical consequences of diffs in Smalltalk/C++
Q96: Do you need to learn a `pure' OOPL before you learn C++?
Q97: What is the NIHCL? Where can I get it?

PART15 -- Reference and value semantics

Q98: What is value and/or reference semantics, and which is best in C++?
Q99: What is `virtual data', and how-can / why-would I use it in C++?
Q100: What's the difference between virtual data and dynamic data?
Q101: Should class subobjects be ptrs to freestore allocated objs, or
Q102: What are relative costs of the 3 performance hits of allocated
Q103: What is an `inline virtual member fn'? Are they ever actually

Activity (6)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
Davies Johnathan liked this
sukirti123 liked this
sharadamar liked this
pwadhai liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->