(Click here for a personal note from Marshall Cline.)
C++ FAQ
/
Section 4
/ FAQ 4.40
Section 4:
4.1
Updates for the 03/12 release?
New!
4.2
Updates for the 11/11 release?
New!
4.3
Updates for the 07/11 release?
4.4
Updates for the 05/11 release?
4.5
Updates for the 03/11 release?
4.6
Updates for the 08/10 release?
4.7
Updates for the 06/10 release?
4.8
Updates for the 05/10 release?
4.9
Updates for the 04/10 release?
4.10
Updates for the 03/10 release?
4.11
Updates for the 01/10 release?
4.12
Updates for the 09/09 release?
4.13
Updates for the 06/09 release?
4.14
Updates for the 01/09 release?
4.15
Updates for the 03/07 release?
4.16
Updates for the 09/06 release?
4.17
Updates for the 03/06 release?
4.18
Updates for the 10/05 release?
4.19
Updates for the 07/05 release?
4.20
Updates for the 06/05 release?
4.21
Updates for the 05/05 release?
4.22
Updates for the 04/05 release?
4.23
Updates for the 03/05 release?
4.24
Updates for the 02/05 release?
4.25
Updates for the 12/04 release?
4.26
Updates for the 06/04 release?
4.27
Updates for the 08/03 release?
4.28
Updates for the 06/03 release?
4.29
Updates for the 05/03 release?
4.30
Updates for the 04/03 release?
4.31
Updates for the 03/03 release?
4.32
Updates for the 02/03 release?
4.33
Updates for the 01/03 release?
4.34
Updates for the 12/02 release?
4.35
Updates for the 09/02 release?
4.36
Updates for the 06/02 release?
4.37
Updates for the 05/02 release?
4.38
Updates for the 04/02 release?
4.39
Updates for the 03/02 release?
4.40
Updates for the 08/01 release?
4.41
Updates for the 04/01 release?
4.42
Updates for the 07/00 release?
4.43
Updates for the 03/00 release?
4.44
Updates for the 01/00 release?
4.45
Updates for the 10/99 release?
4.46
Updates for the 07/99 release?
4.47
Updates for the 06/98 release?
4.48
Updates for the 05/98 release?
4.49
Updates for the 09/97 release?
4.50
Updates for the 01/97 release?
4.51
Updates for the 11/96 release?
4.52
Updates for the 10/96 release?
4.53
Updates for the 09/96 release?
4.54
Updates for the 08/96 release?
4.55
Updates for the 07/96 release?
4.56
Updates for the 06/96 release?
4.57
Updates for the 05/96 release?
4.58
Updates for the 04/96 release?
4.59
Updates for the 03/96 release?
4.60
Updates for the 09/95 release?
4.61
Updates for the 06/95 release?
4.62
Updates for the 04/95 release?
4.63
Updates for the 03/95 release?
4.64
Updates for the 01/95 release?
4.65
Updates for the 12/94 release?
4.66
Updates for the 11/94 release?
4.67
Updates for the 08/94 release?
4.68
Updates for the 08/94 release?
[4.40] What updates were made for the 08/01 release?
New features:
You can now
search the C++ FAQ
(thanks to
www.google.com
).
The FAQ has now been
translated into Chinese using the GB encoding
(typically used on the Chinese mainland).
13 New FAQs:
[4.40] What updates were made for the 08/01 release?
(created)
[5.10] Should I post job advertisements and/or resumés on
comp.lang.c++
?
(created thanks to
David Harmon
and
Brian B. Rodenborn
)
[5.11] What if I really need a job; should I post my resumé on
comp.lang.c++
?
(created thanks to
David Harmon
and
Brian B. Rodenborn
)
[5.12] What should I do to someone who posts something off-topic?
(created)
[5.13] What about spam?
(created)
[10.16] Why doesn't the construct-on-first-use idiom use a static object instead of a static pointer?
(created)
[10.18] Do I need to worry about the "
static
initialization order fiasco" for variables of built-in/intrinsic types?
(created thanks to
Cyril Schmidt
)
[20.6] I have a heterogeneous list of objects, and my code needs to do class-specific things to the objects. Seems like this ought to use dynamic binding but can't figure it out. What should I do?
(created based on an email discussion with
Jeramie Hicks
)
[23.11] How can I set up my class so it won't be inherited from?
(created)
[23.12] How can I set up my member function so it won't be overridden in a derived class?
(created)
[27.11] Why do people worry so much about pointer casts and/or reference casts?
(created)
[29.17] Why doesn't my floating-point comparison work?
(created thanks to
Stan Brown
)
[38.13] Is it possible to convert C++ to C?
(created thanks to
J. Stephen Adamczyk
and
Greg Comeau
)
24 Changed FAQs:
[2.1] Where's the closest mirror site to access this document?
(removed the Finland mirror site — it wasn't being kept up-to-date)
[2.6] Where can I find the C++ FAQ translated into Chinese?
(added the URL for the GB-encoded version thanks to
Shen Min
for the translation)
[10.6] Should my constructors use "initialization lists" or "assignment"?
(reworded various things thanks to
Stan Brown
)
[10.7] Should you use the
this
pointer in the constructor?
(wordsmithed thanks to
Stan Brown
)
[10.14] What's the "
static
initialization order fiasco"?
(closed loophole wrt built-in/intrinsic types thanks to
Cyril Schmidt
)
[10.15] How do I prevent the "
static
initialization order fiasco"?
(closed loophole wrt built-in/intrinsic types thanks to
Cyril Schmidt
)
[10.17] How do I prevent the "
static
initialization order fiasco" for my
static
data members?
(closed loophole wrt built-in/intrinsic types thanks to
Cyril Schmidt
)
[10.20] What is the "Named Parameter Idiom"?
(wordsmithed and added last paragraph with inspiration from
Stan Brown
)
[14.2] Do friends violate encapsulation?
(added the last paragraph with inspiration from
Stan Brown
)
[14.4] What does it mean that "friendship isn't inherited, transitive, or reciprocal"?
(wordsmithed ("nor" vs. "or") thanks to
Herbert Gintis
)
[16.6] Do I need to check for
NULL
after
p = new Fred()
?
(changed
endl
to
std::endl
)
[16.25] Can I absolutely
prevent
people from subverting the reference counting mechanism, and if so,
should
I?
(wordsmithed thanks to
Stan Brown
)
[16.26] Can I use a garbage collector in C++?
(added cross-references thanks to
Stan Brown
)
[16.27] What are the two kinds of garbage collectors for C++?
(added a URL for Attardi and Flagella's CMM thanks to Markus Laker)
[19.7] How can I protect derived classes from breaking when I change the internal parts of the base class?
(wordsmithed thanks to
Stan Brown
)
[20.8] What is a "
virtual
constructor"?
(added the paragraph about MS VC++ 6.0's mishandling of Covariant Return Types; thanks to
Karthik
for pointing this out)
[28.4] Should I buy one book, or several?
(wordsmithed thanks to
Stan Brown
)
[32.1] What do I need to know when mixing C and C++ code?
(fixed a typo thanks to
Kumaran Surrendra
; added the paragraph on compiling everything, even C-style code, using a C++ compiler thanks to
Gary Jenkins
)
[37.2] Where can I get a copy of "STL"?
(added comment about "<string>" thanks to
Stan Brown
)
[38.5] Where can I get information about the C++ compiler from {Borland, IBM, Microsoft, Sun, etc.}?
(added URL for
Digital Mars C++
thanks to
Walter Bright
)
[39.1] How do I convert a value (a number, for example) to a
std::string
?
(changed
<stdio>
to
<cstdio>
thanks to
Stan Brown
)
[39.2] How do I convert a
std::string
to a number?
(changed
<stdio>
to
<cstdio>
thanks to
Stan Brown
)
[39.6] What should be done with macros that need to paste two tokens together?
Updated!
(removed ambivalence regarding second layer of indirection when using
##
thanks to
Joshua Fraser
and
Ronald Fischer
)
[40.2] Is there a TeX or LaTeX macro that fixes the spacing on "C++"?
(wordsmithed thanks to
Stan Brown
)