C++ Questions
- What are the major differences between C and C++?
- What are the differences between new and malloc?
- What is the difference between
delete
anddelete[]
? - What are the differences between a struct in C and in C++?
- What are the advantages/disadvantages of using
#define
? - What are the advantages/disadvantages of using
inline
andconst
?
- What is the difference between a pointer and a reference?
- When would you use a pointer? A reference?
- What does it mean to take the address of a reference?
- What does it mean to declare a function or variable as
static
? - What is the order of initalization for data?
- What is name mangling/name decoration?
- What kind of problems does name mangling cause?
- How do you work around them?
- What is a class?
- What are the differences between a struct and a class in C++?
- What is the difference between public, private, and protected access?
- For
class CFoo { };
what default methods will the compiler generate for you>? - How can you force the compiler to not generate them?
- What is the purpose of a constructor? Destructor?
- What is a constructor initializer list?
- When must you use a constructor initializer list?
- What is a:
- Constructor?
- Destructor?
- Default constructor?
- Copy constructor?
- Conversion constructor?
- What does it mean to declare a...
- member function as
virtual
? - member function as
static
? - member function as
static
? - member variable as
static
? - destructor as
static
?
- member function as
- Can you explain the term "resource acquisition is initialization?"
- What is a "pure virtual" member function?
- What is the difference between public, private, and protected inheritance?
- What is virtual inheritance?
- What is placement
new
? - What is the difference between
operator new
and thenew
operator?
- What is exception handling?
- Explain what happens when an exception is thrown in C++.
- What happens if an exception is not caught?
- What happens if an exception is throws from an object's constructor?
- What happens if an exception is throws from an object's destructor?
- What are the costs and benefits of using exceptions?
- When would you choose to return an error code rather than throw an exception?
- What is a template?
- What is partial specialization or template specialization?
- How can you force instantiation of a template?
- What is an iterator?
- What is an algorithm (in terms of the STL/C++ standard library)?
- What is
std::auto_ptr
? - What is wrong with this statement?
std::auto_ptr
ptr(new char[10]); - It is possible to build a C++ compiler on top of a C compiler. How would you do this? (Note: I've only asked this question once; and yes, he understood that I was asking him how cfront was put together. We hired him.)
暫時(shí)發(fā)布問(wèn)題,大家集思廣益,爭(zhēng)取把每個(gè)問(wèn)題討論的充分一點(diǎn),我會(huì)在最快的時(shí)間給我出的答案:)