C++ FAQ Migration

This page lists a URL mapping from entries in the C++ FAQ maintained by Marshall Cline at parashift.com to the new C++ Super-FAQ at isocpp.org. The mapping was generated by traversing the C++ FAQ and following the redirect links there using some quick Python scripting and might be incomplete and partially incorrect. For each link where a mapping was found, it is shown whether the mapping could be verified. This verification was also done using a quick Python script that checked whether the headlines are (almost) the same. This process is known to have quite some false negatives.

section old new verified
01 Copying permissions
01.01 About the Author
01.02 Copyright Notice
01.03 Copying Permissions
01.04 No Warranty
01.05 Trademarks
01.06 On-line C++-FAQ != C++-FAQ-Book
02 On-line sites that distribute this document
02.01 Where's the closest mirror site to access this document?
02.02 What happened to the one-click-download option?
02.03 Translation to Belorussian (Minsk)?
02.04 Translation to Bosnian / Serbian / Croatian?
02.05 Translation to Bulgarian?
02.06 Translation to Chinese?
02.07 Translation to French?
02.08 Translation to German?
02.09 Translation to Greek?
02.10 Translation to Korean?
02.11 Translation to Polish?
02.12 Translation to Portuguese?
02.13 Translation to Romanian?
02.14 Translation to Russian?
02.15 Translation to Spanish?
02.16 Translation to Turkish?
03 C++-FAQ-Book versus (on-line) C++-FAQ
03.01 Is there a C++ FAQ Book in addition to this on-line C++ FAQ?
03.02 Difference between on-line FAQ and FAQ book?
04 Recent changes to this document
04.01 What updates were made for the 03/12 release? New!
04.02 Updates for the 11/11 release? New!
04.03 Updates for the 07/11 release?
04.04 Updates for the 05/11 release?
04.05 Updates for the 03/11 release?
04.06 Updates for the 08/10 release?
04.07 Updates for the 06/10 release?
04.08 Updates for the 05/10 release?
04.09 Updates for the 04/10 release?
04.10 Updates for the 03/10 release?
04.11 Updates for the 01/10 release?
04.12 Updates for the 09/09 release?
04.13 Updates for the 06/09 release?
04.14 Updates for the 01/09 release?
04.15 Updates for the 03/07 release?
04.16 Updates for the 09/06 release?
04.17 Updates for the 03/06 release?
04.18 Updates for the 10/05 release?
04.19 Updates for the 07/05 release?
04.20 Updates for the 06/05 release?
04.21 Updates for the 05/05 release?
04.22 Updates for the 04/05 release?
04.23 Updates for the 03/05 release?
04.24 Updates for the 02/05 release?
04.25 Updates for the 12/04 release?
04.26 Updates for the 06/04 release?
04.27 Updates for the 08/03 release?
04.28 Updates for the 06/03 release?
04.29 Updates for the 05/03 release?
04.30 Updates for the 04/03 release?
04.31 Updates for the 03/03 release?
04.32 Updates for the 02/03 release?
04.33 Updates for the 01/03 release?
04.34 Updates for the 12/02 release?
04.35 Updates for the 09/02 release?
04.36 Updates for the 06/02 release?
04.37 Updates for the 05/02 release?
04.38 Updates for the 04/02 release?
04.39 Updates for the 03/02 release?
04.40 Updates for the 08/01 release?
04.41 Updates for the 04/01 release?
04.42 Updates for the 07/00 release?
04.43 Updates for the 03/00 release?
04.44 Updates for the 01/00 release?
04.45 Updates for the 10/99 release?
04.46 Updates for the 07/99 release?
04.47 Updates for the 06/98 release?
04.48 Updates for the 05/98 release?
04.49 Updates for the 09/97 release?
04.50 Updates for the 01/97 release?
04.51 Updates for the 11/96 release?
04.52 Updates for the 10/96 release?
04.53 Updates for the 09/96 release?
04.54 Updates for the 08/96 release?
04.55 Updates for the 07/96 release?
04.56 Updates for the 06/96 release?
04.57 Updates for the 05/96 release?
04.58 Updates for the 04/96 release?
04.59 Updates for the 03/96 release?
04.60 Updates for the 09/95 release?
04.61 Updates for the 06/95 release?
04.62 Updates for the 04/95 release?
04.63 Updates for the 03/95 release?
04.64 Updates for the 01/95 release?
04.65 Updates for the 12/94 release?
04.66 Updates for the 11/94 release?
04.67 Updates for the 08/94 release?
04.68 Updates for the 08/94 release?
05 Netiquette when posting to comp.lang.c++
05.01 What does IMHO mean? (or IMO, IMNSHO, FWIW, OTOH, etc.)?
05.02 How do I get other people to do my homework problem for me?
05.03 What should I do if I see someone else posting a homework problem?
05.04 General netiquette?
05.05 What do I do if someone else posts a question that's already in the FAQ?
05.06 Really? Don't answer questions already in the FAQ?
05.07 What makes a good Subject: line?
05.08 How do I post a question about code that doesn't work correctly?
05.09 Which newsgroup should I post my questions?
05.10 Should I post job advertisements and/or resumés on comp.lang.c++?
05.11 What if I really need a job; should I post my resumé on comp.lang.c++?
05.12 What should I do to someone who posts something off-topic?
05.13 What about spam?
05.14 How do I get the FAQs for a particular newsgroup?
06 Big Picture Issues
06.01 Is C++ a practical language? Is C++ a practical language?
06.02 Is C++ a perfect language? Is C++ a perfect language?
06.03 What's the big deal with OO? Updated! What’s the big deal with OO?
06.04 What's the big deal with generic programming? What’s the big deal with generic programming?
06.05 Is C++ better than Ada? (or Visual Basic, C, FORTRAN, Pascal, Smalltalk, or any other language?) Is C++ better than Java? (or C#, C, Objective-C, JavaScript, Ruby, Perl, PHP, Haskell, FORTRAN, Pascal, Ada, Smalltalk, or any other language?)
06.06 Who uses C++? Who uses C++?
06.07 How long does it take to learn OO/C++? How long does it take to learn C++?
06.08 What are some features of C++ from a business perspective? What are some features of C++ from a business perspective?
06.09 Are virtual functions (dynamic binding) central to OO/C++? Are virtual functions (dynamic binding) central to OO/C++?
06.10 Why do virtual functions (dynamic binding) make a big difference? I’m from Missouri. Can you give me a simple reason why virtual functions (dynamic binding, dynamic polymorphism) and templates (static polymorphism) make a big difference?
06.11 Is C++ backward compatible with ANSI/ISO C? Is C++ backward compatible with ANSI/ISO C?
06.12 Is C++ standardized? Updated! Is C++ standardized?
06.13 Where can I get a copy of the ANSI/ISO C++ standard? Where can I get a copy of the C++ standard?
06.14 What are some "interview questions" I could ask that would let me know if candidates really know their stuff? What are some “interview questions” I could ask that would let me know if candidates really know their stuff?
06.15 What does the FAQ mean by "such and such is evil"? What does the FAQ mean by “such and such is evil”?
06.16 Will I sometimes use any so-called "evil" constructs? Will I sometimes use any so-called “evil” constructs?
06.17 Is it important to know the technical definition of "good OO"? Of "good class design"? Is it important to know the technical definition of “good OO”? Of “good class design”?
06.18 What should I tell people who complain that the word "FAQ" is misleading? What should I tell people who complain that the word “FAQ” is misleading, that it emphasizes the questions rather than the answers, and that we should all start using a different acronym?
06.19 How can I help make the C++ FAQ even better??!?? How can I help make the C++ FAQ even better??!??
07 Classes and objects
07.01 What is a class? What is a class?
07.02 What is an object? What is an object?
07.03 When is an interface "good"? When is an interface “good”?
07.04 What is encapsulation? What is encapsulation?
07.05 How does C++ help with the tradeoff of safety vs. usability? How does C++ help with the tradeoff of safety vs. usability?
07.06 How can I prevent other programmers from violating encapsulation by seeing the private parts of my class? How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?
07.07 Can a method directly access the non-public members of another instance of its class? Can a method directly access the non-public members of another instance of its class?
07.08 Is Encapsulation a Security device? Is Encapsulation a Security device?
07.09 What's the difference between the keywords struct and class? What’s the difference between the keywords struct and class?
08 References
08.01 What is a reference? What is a reference?
08.02 What happens if you assign to a reference? What happens if you assign to a reference?
08.03 What happens if you return a reference? What happens if you return a reference?
08.04 What does object.method1().method2() mean? What does object.method1().method2() mean?
08.05 How can you reseat a reference to make it refer to a different object? How can you reseat a reference to make it refer to a different object?
08.06 When should I use references, and when should I use pointers? When should I use references, and when should I use pointers?
08.07 What does it mean that a reference must refer to an object, not a dereferenced NULL pointer? What does it mean that a reference must refer to an object, not a dereferenced null pointer?
08.08 What is a handle to an object? Is it a pointer? Is it a reference? Is it a pointer-to-a-pointer? What is it? What is a handle to an object? Is it a pointer? Is it a reference? Is it a pointer-to-a-pointer? What is it?
09 Inline functions
09.01 What's the deal with inline functions? What’s the deal with inline functions?
09.02 What's a simple example of procedural integration? What’s a simple example of procedural integration?
09.03 Do inline functions improve performance? Do inline functions improve performance?
09.04 How can inline functions help with the tradeoff of safety vs. speed? How can inline functions help with the tradeoff of safety vs. speed?
09.05 Why should I use inline functions instead of plain old #define macros? Why should I use inline functions instead of plain old #define macros?
09.06 How do you tell the compiler to make a non-member function inline? How do you tell the compiler to make a non-member function inline?
09.07 How do you tell the compiler to make a member function inline? How do you tell the compiler to make a member function inline?
09.08 Is there another way to tell the compiler to make a member function inline? Is there another way to tell the compiler to make a member function inline?
09.09 What's a good way to define inline member functions outside the class body? With inline member functions that are defined outside the class, is it best to put the inline keyword next to the declaration within the class body, next to the definition outside the class body, or both?
10 Constructors
10.01 What's the deal with constructors? What’s the deal with constructors?
10.02 Is there any difference between List x; and List x();? Is there any difference between List x; and List x();?
10.03 Can one constructor of a class call another constructor of the same class to initialize the this object? Updated! Can one constructor of a class call another constructor of the same class to initialize the this object?
10.04 Is the default constructor for Fred always Fred::Fred()? Is the default constructor for Fred always Fred::Fred()?
10.05 Which constructor gets called when I create an array of Fred objects? Which constructor gets called when I create an array of Fred objects?
10.06 Should my constructors use "initialization lists" or "assignment"? Should my constructors use “initialization lists” or “assignment”?
10.07 Should you use the this pointer in the constructor? Should you use the this pointer in the constructor?
10.08 What is the "Named Constructor Idiom"? What is the “Named Constructor Idiom”?
10.09 Does return-by-value mean extra copies and extra overhead? Does return-by-value mean extra copies and extra overhead?
10.10 Does the compiler optimize returning a local variable by value? What about returning a local variable by value? Does the local exist as a separate object, or does it get optimized away?
10.11 Why can't I initialize my static member data in my constructor's initialization list? Why can’t I initialize my static member data in my constructor’s initialization list?
10.12 Why are classes with static data members getting linker errors? Why are classes with static data members getting linker errors?
10.13 Can I add = initializer; to the declaration of a class-scope static const data member? Can I add = initializer; to the declaration of a class-scope static const data member?
10.14 What's the "static initialization order fiasco"? What’s the “static initialization order fiasco”?
10.15 How do I prevent the "static initialization order fiasco"? How do I prevent the “static initialization order fiasco”?
10.16 Why doesn't the construct-on-first-use idiom use a static object instead of a static pointer? Why doesn’t the Construct On First Use Idiom use a static object instead of a static pointer?
10.17 How do I prevent the "static initialization order fiasco" for my static data members? How do I prevent the “static initialization order fiasco” for my static data members?
10.18 Do I need to worry about the "static initialization order fiasco" for variables of built-in/intrinsic types? Do I need to worry about the “static initialization order fiasco” for variables of built-in/intrinsic types?
10.19 How can I handle a constructor that fails? How can I handle a constructor that fails?
10.20 What is the "Named Parameter Idiom"? What is the “Named Parameter Idiom”?
10.21 Why am I getting an error after declaring a Foo object via Foo x(Bar())? Why am I getting an error after declaring a Foo object via Foo x(Bar())?
10.22 What is the purpose of the explicit keyword? What is the purpose of the explicit keyword?
11 Destructors
11.01 What's the deal with destructors? What’s the deal with destructors?
11.02 What's the order that local objects are destructed? What’s the order that local objects are destructed?
11.03 What's the order that objects in an array are destructed? What’s the order that objects in an array are destructed?
11.04 Can I overload the destructor for my class? Can I overload the destructor for my class?
11.05 Should I explicitly call a destructor on a local variable? Should I explicitly call a destructor on a local variable?
11.06 Can I call a destructor on a local if I really want to? What if I want a local to “die” before the close } of the scope in which it was created? Can I call a destructor on a local if I really want to?
11.07 How do I handle the situation from the previous FAQ? Okay, okay, already; I won’t explicitly call the destructor of a local; but how do I handle the situation from the previous FAQ?
11.08 What if I can't wrap the local in an artificial block? What if I can’t wrap the local in an artificial block?
11.09 Explicitly calling dtor for objects allocated with new? But can I explicitly call a destructor if I’ve allocated my object with new?
11.10 What is "placement new" and why would I use it? What is “placement new” and why would I use it?
11.11 Should a dtor call the dtors for member objects? When I write a destructor, do I need to explicitly call the destructors for my member objects?
11.12 Should a dtor call the dtors for the base class subobject? When I write a derived class’s destructor, do I need to explicitly call the destructor for my base class?
11.13 Should my destructor throw an exception when it detects a problem? Should my destructor throw an exception when it detects a problem?
11.14 Getting new to allocate memory from a specific memory area? Is there a way to force new to allocate memory from a specific memory area?
12 Assignment operators
12.01 What is "self assignment"? What is “self assignment”?
12.02 Why should I worry about "self assignment"? Why should I worry about “self assignment”?
12.03 How do I handle self-assignment? Okay, okay, already; I’ll handle self-assignment. How do I do it?
12.04 Should my assignment operator call my base class's assignment operator? I’m creating a derived class; should my assignment operators call my base class’s assignment operators?
13 Operator overloading
13.01 What's the deal with operator overloading? What’s the deal with operator overloading?
13.02 What are the benefits of operator overloading? What are the benefits of operator overloading?
13.03 What are some examples of operator overloading? What are some examples of operator overloading?
13.04 Is operator overloading supposed to make the class' code clearer? But operator overloading makes my class look ugly; isn’t it supposed to make my code clearer?
13.05 What operators can/cannot be overloaded? What operators can/cannot be overloaded?
13.06 Overloading operator== to use string comparison? Can I overload operator== so it lets me compare two char[] using a string comparison?
13.07 Can I create operator** for to-the-power-of? Can I create a operator** for “to-the-power-of” operations?
13.08 But which operators should I override? The previous FAQs tell me which operators I can override; but which operators should I override?
13.09 Guidelines / "rules of thumb" for overloading operators? What are some guidelines / “rules of thumb” for overloading operators?
13.10 Creating a subscript operator for a Matrix class? How do I create a subscript operator for a Matrix class?
13.11 Should my Matrix interface look like an array-of-array? Why shouldn’t my Matrix class’s interface look like an array-of-array?
13.12 Part two of making my Matrix interface look like an array-of-array? I still don’t get it. Why shouldn’t my Matrix class’s interface look like an array-of-array?
13.13 Designing classes from the outside-in vs. inside-out? Should I design my classes from the outside (interfaces first) or from the inside (data first)?
13.14 Overloading prefix/postfix forms of operators ++ and --? How can I overload the prefix and postfix forms of operators ++ and --?
13.15 Which is more efficient: i++ or ++i? Which is more efficient: i++ or ++i?
14 Friends
14.01 What is a friend? What is a friend?
14.02 Do friends violate encapsulation? Do friends violate encapsulation?
14.03 Pros/const of usign friend functions? What are some advantages/disadvantages of using friend functions?
14.04 Meaning of "friendship isn't inherited, transitive, or reciprocal"? What does it mean that “friendship isn’t inherited, transitive, or reciprocal”?
14.05 Declaring a member function or a friend function? Should my class declare a member function or a friend function?
15 Input/output via <iostream> and <cstdio>
15.01 Why should I use <iostream> instead of the traditional <cstdio>? Why should I use <iostream> instead of the traditional <cstdio>?
15.02 Understanding infinite loop when the input is invalid? Why does my program go into an infinite loop when someone enters an invalid input character?
15.03 How can I get std::cin to skip invalid input characters? How can I get std::cin to skip invalid input characters?
15.04 How does that funky while (std::cin >> foo) syntax work? How does that funky while (std::cin >> foo) syntax work?
15.05 Why does my input seem to process past the end of file? Why does my input seem to process past the end of file?
15.06 Why is my program ignoring my input request after the first iteration? Why is my program ignoring my input request after the first iteration?
15.07 Should I end my output lines with std::endl or '\n'? Should I end my output lines with std::endl or '\n'?
15.08 How can I provide printing for my class Fred? How can I provide printing for my class Fred?
15.09 Using a printOn() method vs. a friend function? But shouldn’t I always use a printOn() method rather than a friend function?
15.10 How can I provide input for my class Fred? How can I provide input for my class Fred?
15.11 Providing printing for an entire hierarchy of classes? How can I provide printing for an entire hierarchy of classes?
15.12 How can I open a stream in binary mode? How can I open a stream in binary mode?
15.13 "Reopening" std::cin and std::cout in binary mode? How can I “reopen” std::cin and std::cout in binary mode?
15.14 How can I write/read objects of my class to/from a data file? How can I write/read objects of my class to/from a data file?
15.15 Sending objects over a network? How can I send objects of my class to another computer (e.g., via a socket, TCP/IP, FTP, email, a wireless link, etc.)?
15.16 Backslashes in filenames? Why can’t I open a file in a different directory such as "..\test.dat"?
15.17 How to capture key presses before the ENTER key? How can I tell (if a key, which key) was pressed before the user presses the ENTER key?
15.18 How to turn off screen echo on keyboard input? How can I make it so keys pressed by users are not echoed on the screen?
15.19 How can I move the cursor around on the screen? How can I move the cursor around on the screen?
15.20 How can I clear the screen? How can I clear the screen? Is there something like clrscr()?
15.21 How can I change the colors on the screen? How can I change the colors on the screen?
15.22 How can I print the numeric value of a char or char*? Updated! How can I print a char as a number? How can I print a char* so the output shows the pointer’s numeric value?
16 Freestore management
16.01 Does delete p delete the pointer p, or the pointed-to-data *p? Does delete p delete the pointer p, or the pointed-to-data *p?
16.02 Is it safe to delete the same pointer twice? Is it safe to delete the same pointer twice?
16.03 Can I free() pointers allocated with new? Can I delete pointers allocated with malloc()? Can I free() pointers allocated with new? Can I delete pointers allocated with malloc()?
16.04 Benefits of new over malloc()? Why should I use new instead of trustworthy old malloc()?
16.05 Can I use realloc() on pointers allocated via new? Can I use realloc() on pointers allocated via new?
16.06 Checking for NULL after p = new Fred()? Do I need to check for null after p = new Fred()?
16.07 How can I convince my (older) compiler to automatically check new to see if it returns NULL? How can I convince my (older) compiler to automatically check new to see if it returns null?
16.08 Checking for NULL before delete p? Do I need to check for null before delete p?
16.09 What are the two steps that happen when I say delete p? What are the two steps that happen when I say delete p?
16.10 Does p = new Fred() leak memory if the ctor throws an exception? In p = new Fred(), does the Fred memory “leak” if the Fred constructor throws an exception?
16.11 How do I allocate / unallocate an array of things? How do I allocate / unallocate an array of things?
16.12 What if I forget the [] when deleteing an array allocated via new T[n]? What if I forget the [] when deleteing an array allocated via new T[n]?
16.13 Can I drop the [] when deleteing an array of some built-in type (char, int, etc)? Can I drop the [] when deleteing an array of some built-in type (char, int, etc)?
16.14 After p = new Fred[n], how does the compiler know there are n objects to be destructed during delete[] p? After p = new Fred[n], how does the compiler know there are n objects to be destructed during delete[] p?
16.15 Is it legal (and moral) for a member function to say delete this? Is it legal (and moral) for a member function to say delete this?
16.16 How do I allocate multidimensional arrays using new? How do I allocate multidimensional arrays using new?
16.17 How to simplify the Matrix code from the previous FAQ? But the previous FAQ’s code is SOOOO tricky and error prone! Isn’t there a simpler way?
16.18 How to make the Matrix class generic? But the above Matrix class is specific to Fred! Isn’t there a way to make it generic?
16.19 What's another way to build a Matrix template? What’s another way to build a Matrix template?
16.20 Does C++ have arrays whose length can be specified at run-time? Does C++ have arrays whose length can be specified at run-time?
16.21 Allocating all objects via new, not local/global/static? How can I force objects of my class to always be created via new rather than as local, namespace-scope, global, or static?
16.22 How do I do simple reference counting? How do I do simple reference counting?
16.23 How do I provide reference counting with copy-on-write semantics? How do I provide reference counting with copy-on-write semantics?
16.24 How do I provide reference counting with copy-on-write semantics for a hierarchy of classes? How do I provide reference counting with copy-on-write semantics for a hierarchy of classes?
16.25 Preventing people from subverting the reference counting mechanism? Can I absolutely prevent people from subverting the reference counting mechanism, and if so, should I?
16.26 Can I use a garbage collector in C++? Can I use a garbage collector in C++?
16.27 What are the two kinds of garbage collectors for C++? What are the two kinds of garbage collectors for C++?
16.28 Where can I get more info on garbage collectors for C++? Where can I get more info on garbage collectors for C++?
17 Exceptions and error handling
17.01 What are some ways try / catch / throw can improve software quality? What are some ways try / catch / throw can improve software quality?
17.02 Do the benefits of exceptions show up with tiny programs? I’m still not convinced: a 4-line code snippet shows that return-codes aren’t any worse than exceptions; why should I therefore use exceptions on an application that is orders of magnitude larger?
17.03 How do exceptions simplify my function return type and parameter types? How do exceptions simplify my function return type and parameter types?
17.04 Do exceptions separate the "happy path" from the "bad path"? What does it mean that exceptions separate the “good path” (or “happy path”) from the “bad path”?
17.05 Okay, so you're saying exception handling is easy and simple, right? I’m interpreting the previous FAQs as saying exception handling is easy and simple; did I get it right?
17.06 Mindset and discipline for exception handling? Exception handling seems to make my life more difficult; that must mean exception handling itself is bad; clearly I’m not the problem, right??
17.07 I have too many try blocks; what can I do about it? I have too many try blocks; what can I do about it?
17.08 How can I handle a constructor that fails? How can I handle a constructor that fails?
17.09 How can I handle a destructor that fails? How can I handle a destructor that fails?
17.10 How should I handle resources if my constructors may throw exceptions? How should I handle resources if my constructors may throw exceptions?
17.11 How to prevent memory leaks when exceptions are thrown? How do I change the string-length of an array of char to prevent memory leaks even if/when someone throws an exception?
17.12 What should I throw? What should I throw?
17.13 What should I catch? What should I catch?
17.14 But MFC seems to encourage the use of catch-by-pointer; should I do the same? But MFC seems to encourage the use of catch-by-pointer; should I do the same?
17.15 Meaning and use of throw; (without an object)? What does throw; (without an exception object after the throw keyword) mean? Where would I use it?
17.16 How do I throw polymorphically? How do I throw polymorphically?
17.17 When I throw this object, how many times will it be copied? When I throw this object, how many times will it be copied?
18 Const correctness
18.01 What is "const correctness"? What is “const correctness”?
18.02 How is "const correctness" related to ordinary type safety? How is “const correctness” related to ordinary type safety?
18.03 Should I try to get things const correct "sooner" or "later"? Should I try to get things const correct “sooner” or “later”?
18.04 What does "Fred const* p" mean? What does “const X* p” mean?
18.05 Difference between "Fred const* p", "Fred* const p" and "Fred const* const p"? What’s the difference between “const X* p”, “X* const p” and “const X* const p”?
18.06 What does "Fred const& x" mean? What does “const X& x” mean?
18.07 Does "Fred& const x" make any sense? Does “X& const x” make any sense?
18.08 What does "const X& x" mean? What do “X const& x” and “X const* p” mean?
18.09 What does "const X* x" mean?
18.10 What is a "const member function"? What is a “const member function”?
18.11 Using return-by-reference in a const member function? What is the relationship between a return-by-reference and a const member function?
18.12 What's the deal with "const-overloading"? What’s the deal with “const-overloading”?
18.13 How a const member function can make an "invisible" change to a data member? What do I do if I want a const member function to make an “invisible” change to a data member?
18.14 Does const_cast mean lost optimization opportunities? Does const_cast mean lost optimization opportunities?
18.15 Binding a pointer-to-const to a non-const object? Why does the compiler allow me to change an int after I’ve pointed at it with a const int*?
18.16 Does "Fred const* p" mean that *p can't change? Does “const Fred* p” mean that *p can’t change?
18.17 Errors trying to convert Foo** Foo const**? Why am I getting an error converting a Foo**const Foo**?
19 Inheritance — basics
19.01 Is inheritance important to C++? Is inheritance important to C++?
19.02 When would I use inheritance? When would I use inheritance?
19.03 How do you express inheritance in C++? How do you express inheritance in C++?
19.04 Is it OK to convert a pointer from a derived class to its base class? Is it okay to convert a pointer from a derived class to its base class?
19.05 What's the difference between public, private, and protected? What’s the difference between public, private, and protected?
19.06 Why can't my derived class access private things from my base class? Why can’t my derived class access private things from my base class?
19.07 How can I protect derived classes from breaking when I change the internal parts of the base class? How can I protect derived classes from breaking when I change the internal parts of the base class?
19.08 Protected data vs. private data with protected access functions? I’ve been told to never use protected data, and instead to always use private data with protected access functions. Is that a good rule?
19.09 Okay, so exactly how should I decide whether to build a "protected interface"? Okay, so exactly how should I decide whether to build a “protected interface”?
20 Inheritance — virtual functions
20.01 What is a "virtual member function"? What is a “virtual member function”?
20.02 How can C++ achieve dynamic binding yet also static typing? How can C++ achieve dynamic binding yet also static typing?
20.03 Difference between calling virtual and non-virtual member functions? What’s the difference between how virtual and non-virtual member functions are called?
20.04 Implementation details and efficiency of calling a virtual function? What happens in the hardware when I call a virtual function? How many layers of indirection are there? How much overhead is there?
20.05 How can a member function in my derived class call the same function from its base class? How can a member function in my derived class call the same function from its base class?
20.06 Using dynamic binding with objects in heterogeneous containers? 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?
20.07 When should my destructor be virtual? When should my destructor be virtual?
20.08 What is a "virtual constructor"? What is a “virtual constructor”?
21 Inheritance — proper inheritance and substitutability
21.01 Should I hide member functions that were public in my base class? Should I hide member functions that were public in my base class?
21.02 Errors trying to convert Derived** Base**? Converting Derived*Base* works okay; why doesn’t Derived**Base** work?
21.03 Is a parking-lot-of-Car a kind-of parking-lot-of-Vehicle? Is a parking-lot-of-Car a kind-of parking-lot-of-Vehicle?
21.04 Is an array of Derived a kind-of array of Base? Is an array of Derived a kind-of array of Base?
21.05 Does array-of-Derived is-not-a-kind-of array-of-Base mean arrays are bad? Does array-of-Derived is-not-a-kind-of array-of-Base mean arrays are bad?
21.06 Is a Circle a kind-of an Ellipse? Is a Circle a kind-of an Ellipse?
21.07 Are there other options to the "Circle is/isnot kind-of Ellipse" dilemma? Are there other options to the “Circle is/isnot kind-of Ellipse” dilemma?
21.08 Why does this Circle-kind-of-Ellipse problem seem confusing? But I have a Ph.D. in Mathematics, and I’m sure a Circle is a kind of an Ellipse! Does this mean Marshall Cline is stupid? Or that C++ is stupid? Or that OO is stupid?
21.09 Perhaps Ellipse should inherit from Circle then? Perhaps Ellipse should inherit from Circle then?
21.10 But my problem doesn't have anything to do with circles and ellipses, so what good is that silly example to me? But my problem doesn’t have anything to do with circles and ellipses, so what good is that silly example to me?
21.11 How could "it depend"??!? Aren't terms like "Circle" and "Ellipse" defined mathematically? How could “it depend”??!? Aren’t terms like “Circle” and “Ellipse” defined mathematically?
21.12 Is SortedList a kind-of List? If SortedList has exactly the same public interface as List, is SortedList a kind-of List?
22 Inheritance — abstract base classes (ABCs)
22.01 What's the big deal of separating interface from implementation? What’s the big deal of separating interface from implementation?
22.02 How do I separate interface from implementation in C++ (like Modula-2)? How do I separate interface from implementation in C++ (like Modula-2)?
22.03 What is an ABC? What is an ABC?
22.04 What is a "pure virtual" member function? What is a “pure virtual” member function?
22.05 How do you define a copy constructor or assignment operator for a class that contains a pointer to a (abstract) base class? How do you define a copy constructor or assignment operator for a class that contains a pointer to a (abstract) base class?
23 Inheritance — what your mother never told you
23.01 Is it okay for a non-virtual function of the base class to call a virtual function? Is it okay for a non-virtual function of the base class to call a virtual function?
23.02 That last FAQ confuses me. Is it a different strategy from the other ways to use virtual functions? What's going on? That last FAQ confuses me. Is it a different strategy from the other ways to use virtual functions? What’s going on?
23.03 Should I use protected virtuals instead of public virtuals? Should I use protected virtuals instead of public virtuals?
23.04 When should someone use private virtuals? When should someone use private virtuals?
23.05 When my base class's constructor calls a virtual function on its this object, why doesn't my derived class's override of that virtual function get invoked? When my base class’s constructor calls a virtual function on its this object, why doesn’t my derived class’s override of that virtual function get invoked?
23.06 Okay, but is there a way to simulate that behavior as if dynamic binding worked on the this object within my base class's constructor? Okay, but is there a way to simulate that behavior as if dynamic binding worked on the this object within my base class’s constructor?
23.07 I'm getting the same mess with destructors: calling a virtual on my this object from my base class's destructor ends up ignoring the override in the derived class; what's going on? I’m getting the same thing with destructors: calling a virtual on my this object from my base class’s destructor ends up ignoring the override in the derived class; what’s going on?
23.08 Should a derived class redefine ("override") a member function that is non-virtual in a base class? Should a derived class redefine (“override”) a member function that is non-virtual in a base class?
23.09 What's the meaning of, Warning: Derived::f(char) hides Base::f(double)? What’s the meaning of, Warning: Derived::f(char) hides Base::f(double)?
23.10 What does it mean that the "virtual table" is an unresolved external? What does it mean that the “virtual table” is an unresolved external?
23.11 How can I set up my class so it won't be inherited from? How can I set up my class so it won’t be inherited from?
23.12 How can I set up my member function so it won't be overridden in a derived class? How can I set up my member function so it won’t be overridden in a derived class?
24 Inheritance — private and protected inheritance
24.01 How do you express "private inheritance"? How do you express “private inheritance”?
24.02 How are "private inheritance" and "composition" similar? How are “private inheritance” and “composition” similar?
24.03 Which should I prefer: composition or private inheritance? Which should I prefer: composition or private inheritance?
24.04 Should I pointer-cast from a private derived class to its base class? Should I pointer-cast from a private derived class to its base class?
24.05 How is protected inheritance related to private inheritance? How is protected inheritance related to private inheritance?
24.06 What are the access rules with private and protected inheritance? What are the access rules with private and protected inheritance?
25 Inheritance — multiple and virtual inheritance
25.01 How is this section organized? How is this section organized?
25.02 I've been told that I should never use multiple inheritance. Is that right? I’ve been told that I should never use multiple inheritance. Is that right?
25.03 So there are times when multiple inheritance isn't bad?!?? So there are times when multiple inheritance isn’t bad?!??
25.04 What are some disciplines for using multiple inheritance? What are some disciplines for using multiple inheritance?
25.05 Can you provide an example that demonstrates the above guidelines? Can you provide an example that demonstrates the above guidelines?
25.06 Is there a simple way to visualize all these tradeoffs? Is there a simple way to visualize all these tradeoffs?
25.07 Can you give another example to illustrate the above disciplines? Can you give another example to illustrate the above disciplines?
25.08 What is the "dreaded diamond"? What is the “dreaded diamond”?
25.09 Where in a hierarchy should I use virtual inheritance? Where in a hierarchy should I use virtual inheritance?
25.10 What does it mean to "delegate to a sister class" via virtual inheritance? What does it mean to “delegate to a sister class” via virtual inheritance?
25.11 What special considerations do I need to know about when I use virtual inheritance? What special considerations do I need to know about when I use virtual inheritance?
25.12 What special considerations do I need to know about when I inherit from a class that uses virtual inheritance? What special considerations do I need to know about when I inherit from a class that uses virtual inheritance?
25.13 What special considerations do I need to know about when I use a class that uses virtual inheritance? What special considerations do I need to know about when I use a class that uses virtual inheritance?
25.14 One more time: what is the exact order of constructors in a multiple and/or virtual inheritance situation? One more time: what is the exact order of constructors in a multiple and/or virtual inheritance situation?
25.15 What is the exact order of destructors in a multiple and/or virtual inheritance situation? What is the exact order of destructors in a multiple and/or virtual inheritance situation?
26 Built-in / intrinsic / primitive data types
26.01 Can sizeof(char) be 2 on some machines? For example, what about double-byte characters? Can sizeof(char) be 2 on some machines? For example, what about double-byte characters?
26.02 What are the units of sizeof? What are the units of sizeof?
26.03 Whoa, but what about machines or compilers that support multibyte characters. Are you saying that a "character" and a char might be different?!? Whoa, but what about machines or compilers that support multibyte characters. Are you saying that a “character” and a char might be different?!?
26.04 But, but, but what about machines where a char has more than 8 bits? Surely you're not saying a C++ byte might have more than 8 bits, are you?!? But, but, but what about machines where a char has more than 8 bits? Surely you’re not saying a C++ byte might have more than 8 bits, are you?!?
26.05 Okay, I could imagine a machine with 9-bit bytes. But surely not 16-bit bytes or 32-bit bytes, right? Okay, I could imagine a machine with 9-bit bytes. But surely not 16-bit bytes or 32-bit bytes, right?
26.06 I'm sooooo confused. Would you please go over the rules about bytes, chars, and characters one more time? I’m sooooo confused. Would you please go over the rules about bytes, chars, and characters one more time?
26.07 What is a "POD type"? What is a “POD type”?
26.08 When initializing non-static data members of built-in / intrinsic / primitive types, should I use the "initialization list" or assignment? When initializing non-static data members of built-in / intrinsic / primitive types, should I use the “initialization list” or assignment?
26.09 When initializing static data members of built-in / intrinsic / primitive types, should I worry about the "static initialization order fiasco"? When initializing static data members of built-in / intrinsic / primitive types, should I worry about the “static initialization order fiasco”?
26.10 Can I define an operator overload that works with built-in / intrinsic / primitive types? Can I define an operator overload that works with built-in / intrinsic / primitive types?
26.11 When I delete an array of some built-in / intrinsic / primitive type, why can't I just say delete a instead of delete[] a? When I delete an array of some built-in / intrinsic / primitive type, why can’t I just say delete a instead of delete[] a?
26.12 How can I tell if an integer is a power of two without looping? How can I tell if an integer is a power of two without looping?
26.13 What should be returned from a function? What should be returned from a function?
27 Coding standards
27.01 What are some good C++ coding standards? What are some good C++ coding standards?
27.02 Are coding standards necessary? Are they sufficient? Are coding standards necessary? Are they sufficient?
27.03 Should our organization determine coding standards from our C experience? Should our organization determine coding standards from our C experience?
27.04 What's the difference between <xxx> and <xxx.h> headers? What’s the difference between <xxx> and <xxx.h> headers?
27.05 Should I use using namespace std in my code? Should I use using namespace std in my code?
27.06 Is the ?: operator evil since it can be used to create unreadable code? Is the ?: operator evil since it can be used to create unreadable code?
27.07 Should I declare locals in the middle of a function or at the top? Should I declare locals in the middle of a function or at the top?
27.08 What source-file-name convention is best? foo.cpp? foo.C? foo.cc? What source-file-name convention is best? foo.cpp? foo.C? foo.cc?
27.09 What header-file-name convention is best? foo.H? foo.hh? foo.hpp? What header-file-name convention is best? foo.H? foo.hh? foo.hpp?
27.10 Are there any lint-like guidelines for C++? Are there any lint-like guidelines for C++?
27.11 Why do people worry so much about pointer casts and/or reference casts? Why do people worry so much about pointer casts and/or reference casts?
27.12 Which is better: identifier names that_look_like_this or identifier names thatLookLikeThis? Which is better: identifier names that_look_like_this or identifier names thatLookLikeThis?
27.13 Are there any other sources of coding standards? Are there any other sources of coding standards?
27.14 Should I use "unusual" syntax? Should I use “unusual” syntax?
27.15 What's a good coding standard for using global variables? New! What’s a good coding standard for using global variables?
28 Learning OO/C++
28.01 What is mentoring? What is mentoring?
28.02 Should I learn C before I learn OO/C++?
28.03 Should I learn Smalltalk before I learn OO/C++?
28.04 Should I buy one book, or several? Should I buy one book, or several?
28.05 What are some best-of-breed C++ morality guides? What are some best-of-breed C++ morality guides?
28.06 What are some best-of-breed C++ legality guides? What are some best-of-breed C++ legality guides?
28.07 What are some best-of-breed C++ programming-by-example guides? What are some best-of-breed C++ programming-by-example guides?
28.08 Are there other OO books that are relevant to OO/C++? Are there other books that are relevant to C++?
29 Newbie Questions / Answers
29.01 What is this "newbie section" all about? What is this “newbie section” all about?
29.02 Where do I start? Why do I feel so confused, so stupid? Where do I start? Why do I feel so confused, so stupid?
29.03 Should I use void main() or int main()? Should I use void main() or int main()?
29.04 Should I use f(void) or f()? Should I use f(void) or f()?
29.05 What are the criteria for choosing between short / int / long data types? What are the criteria for choosing between short / int / long data types?
29.06 What the heck is a const variable? Isn't that a contradiction in terms? What the heck is a const variable? Isn’t that a contradiction in terms?
29.07 Why would I use a const variable / const identifier as opposed to #define? Why would I use a const variable / const identifier as opposed to #define?
29.08 Are you saying that the preprocessor is evil? Are you saying that the preprocessor is evil?
29.09 What is the "standard library"? What is included / excluded from it? What is the “standard library”? What is included / excluded from it?
29.10 How should I lay out my code? When should I use spaces, tabs, and/or newlines in my code? How should I lay out my code? When should I use spaces, tabs, and/or newlines in my code?
29.11 Is it okay if a lot of numbers appear in my code? Is it okay if a lot of numbers appear in my code?
29.12 What's the point of the L, U and f suffixes on numeric literals? What’s the point of the L, U and f suffixes on numeric literals?
29.13 I can understand the and (&&) and or (||) operators, but what's the purpose of the not (!) operator? I can understand the and (&&) and or (||) operators, but what’s the purpose of the not (!) operator?
29.14 Is !(a < b) logically the same as a >= b? Is !(a < b) logically the same as a >= b?
29.15 What is this NaN thing? What is this NaN thing?
29.16 Why is floating point so inaccurate? Why doesn't this print 0.43? Why is floating point so inaccurate? Why doesn’t this print 0.43?
29.17 Why doesn't my floating-point comparison work? Why doesn’t my floating-point comparison work?
29.18 Why is cos(x) != cos(y) even though x == y? (Or sine or tangent or log or just about any other floating point computation) Why is cos(x) != cos(y) even though x == y? (Or sine or tangent or log or just about any other floating point computation)
29.19 What is the type of an enumeration such as enum Color? Is it of type int? What is the type of an enumeration such as enum Color? Is it of type int?
29.20 If an enumeration type is distinct from any other type, what good is it? What can you do with it? If an enumeration type is distinct from any other type, what good is it? What can you do with it?
29.21 What other "newbie" guides are there for me? What other “newbie” guides are there for me?
30 Learning C++ if you already know Smalltalk
30.01 What's the difference between C++ and Smalltalk?
30.02 What is "static typing," and how is it similar/dissimilar to Smalltalk?
30.03 Which is a better fit for C++: "static typing" or "dynamic typing"? Which is a better fit for C++: “static typing” or “dynamic typing”?
30.04 How do you use inheritance in C++, and is that different from Smalltalk?
30.05 What are the practical consequences of differences in Smalltalk/C++ inheritance?
31 Reference and value semantics
31.01 What is value and/or reference semantics, and which is best in C++? What is value and/or reference semantics, and which is best in C++?
31.02 What is "virtual data," and how-can / why-would I use it in C++? What is “virtual data,” and how-can / why-would I use it in C++?
31.03 What's the difference between virtual data and dynamic data? What’s the difference between virtual data and dynamic data?
31.04 Should I normally use pointers to freestore allocated objects for my data members, or should I use "composition"? Should I normally use pointers to freestore allocated objects for my data members, or should I use “composition”?
31.05 What are relative costs of the 3 performance hits associated with allocating member objects from the freestore? What are relative costs of the 3 performance hits associated with allocating member objects from the freestore?
31.06 Are "inline virtual" member functions ever actually "inlined"? Are “inline virtual” member functions ever actually “inlined”?
31.07 Sounds like I should never use reference semantics, right? Sounds like I should never use reference semantics, right?
31.08 Does the poor performance of reference semantics mean I should pass-by-value? Does the poor performance of reference semantics mean I should pass-by-value?
32 How to mix C and C++
32.01 What do I need to know when mixing C and C++ code? What do I need to know when mixing C and C++ code?
32.02 How can I include a standard C header file in my C++ code? How can I include a standard C header file in my C++ code?
32.03 How can I include a non-system C header file in my C++ code? How can I include a non-system C header file in my C++ code?
32.04 How can I modify my own C header files so it's easier to #include them in C++ code? How can I modify my own C header files so it’s easier to #include them in C++ code?
32.05 How can I call a non-system C function f(int,char,float) from my C++ code? How can I call a non-system C function f(int,char,float) from my C++ code?
32.06 How can I create a C++ function f(int,char,float) that is callable by my C code? How can I create a C++ function f(int,char,float) that is callable by my C code?
32.07 Why is the linker giving errors for C/C++ functions being called from C++/C functions? Why is the linker giving errors for C/C++ functions being called from C++/C functions?
32.08 How can I pass an object of a C++ class to/from a C function? How can I pass an object of a C++ class to/from a C function?
32.09 Can my C function directly access data in an object of a C++ class? Can my C function directly access data in an object of a C++ class?
32.10 Why do I feel like I'm "further from the machine" in C++ as opposed to C? Why do I feel like I’m “further from the machine” in C++ as opposed to C?
33 Pointers to member functions
33.01 Is the type of "pointer-to-member-function" different from "pointer-to-function"? Is the type of “pointer-to-member-function” different from “pointer-to-function”?
33.02 How do I pass a pointer-to-member-function to a signal handler, X event callback, system call that starts a thread/task, etc? How do I pass a pointer-to-member-function to a signal handler, X event callback, system call that starts a thread/task, etc?
33.03 Why do I keep getting compile errors (type mismatch) when I try to use a member function as an interrupt service routine? Why do I keep getting compile errors (type mismatch) when I try to use a member function as an interrupt service routine?
33.04 Why am I having trouble taking the address of a C++ function? Why am I having trouble taking the address of a C++ function?
33.05 How can I avoid syntax errors when creating pointers to members? How can I avoid syntax errors when creating pointers to members?
33.06 How can I avoid syntax errors when calling a member function using a pointer-to-member-function? How can I avoid syntax errors when calling a member function using a pointer-to-member-function?
33.07 How do I create and use an array of pointer-to-member-function? How do I create and use an array of pointer-to-member-function?
33.08 How do I declare a pointer-to-member-function that points to a const member function? How do I declare a pointer-to-member-function that points to a const member function?
33.09 What is the difference between the .* and ->* operators? What is the difference between the .* and ->* operators?
33.10 Can I convert a pointer-to-member-function to a void*? Can I convert a pointer-to-member-function to a void*?
33.11 Can I convert a pointer-to-function to a void*? Can I convert a pointer-to-function to a void*?
33.12 I need something like function-pointers, but with more flexibility and/or thread-safety; is there another way? I need something like function-pointers, but with more flexibility and/or thread-safety; is there another way?
33.13 What the heck is a functionoid, and why would I use one? What the heck is a functionoid, and why would I use one?
33.14 Can you make functionoids faster than normal function calls? Can you make functionoids faster than normal function calls?
33.15 What's the difference between a functionoid and a functor? What’s the difference between a functionoid and a functor?
34 Container classes
34.01 Why should I use container classes rather than simple arrays? Why should I use container classes rather than simple arrays?
34.02 How can I make a perl-like associative array in C++? How can I make a perl-like associative array in C++?
34.03 Is the storage for a std::vector<T> guaranteed to be contiguous? Is the storage for a std::vector<T> or a std::array<T,N> guaranteed to be contiguous?
34.04 How can I build a <favorite container> of objects of different types? How can I build a heterogeneous <favorite container> of objects of different types?
34.05 How can I insert/access/change elements from a linked list/hashtable/etc? How can I insert/access/change elements from a linked list/hashtable/etc?
34.06 Can I have a container of smart pointers to my objects? Can I have a container of smart pointers to my objects?
35 Templates
35.01 What's the idea behind templates? What’s the idea behind templates?
35.02 What's the syntax / semantics for a "class template"? What’s the syntax / semantics for a “class template”?
35.03 What's the syntax / semantics for a "function template"? What’s the syntax / semantics for a “function template”?
35.04 How do I explicitly select which version of a function template should get called? How do I explicitly select which version of a function template should get called?
35.05 What is a "parameterized type"? What is a “parameterized type”?
35.06 What is "genericity"? What is “genericity”?
35.07 My template function does something special when the template type T is int or std::string; how do I write my template so it uses the special code when T is one of those specific types? My template function does something special when the template type T is int or std::string; how do I write my template so it uses the special code when T is one of those specific types?
35.08 Huh? Can you provide an example of template specialization that doesn't use foo and bar? Huh? Can you provide an example of template specialization that doesn’t use foo and bar?
35.09 But most of the code in my template function is the same; is there some way to get the benefits of template specialization without duplicating all that source code? But most of the code in my template function is the same; is there some way to get the benefits of template specialization without duplicating all that source code?
35.10 All those templates and template specializations must slow down my program, right? All those templates and template specializations must slow down my program, right?
35.11 So templates are overloading, right? So templates are overloading, right?
35.12 Why can't I separate the definition of my templates class from its declaration and put it inside a .cpp file? Why can’t I separate the definition of my templates class from its declaration and put it inside a .cpp file?
35.13 How can I avoid linker errors with my template functions? Updated! How can I avoid linker errors with my template functions?
35.14 How does the C++ keyword export help with template linker errors? Updated! How does the C++ keyword export help with template linker errors?
35.15 How can I avoid linker errors with my template classes? Updated! How can I avoid linker errors with my template classes?
35.16 Why do I get linker errors when I use template friends? Why do I get linker errors when I use template friends?
35.17 How can any human hope to understand these overly verbose template-based error messages? How can any human hope to understand these overly verbose template-based error messages?
35.18 Why am I getting errors when my template-derived-class uses a nested type it inherits from its template-base-class? Why am I getting errors when my template-derived-class uses a nested type it inherits from its template-base-class?
35.19 Why am I getting errors when my template-derived-class uses a member it inherits from its template-base-class? Why am I getting errors when my template-derived-class uses a member it inherits from its template-base-class?
35.20 Can the previous problem hurt me silently? Is it possible that the compiler will silently generate the wrong code? Can the previous problem hurt me silently? Is it possible that the compiler will silently generate the wrong code?
35.21 How can I create a container-template that allows my users to supply the type of the underlying container that actually stores the values? How can I create a container-template that allows my users to supply the type of the underlying container that actually stores the values?
35.22 Follow-up to previous: can I pass in the underlying structure and the element-type separately? Follow-up to previous: can I pass in the underlying structure and the element-type separately?
35.23 Related: all those proxies must negatively reflect on the speed of my program. Don't they? Related: all those proxies must negatively reflect on the speed of my program. Don’t they?
36 Serialization and Unserialization
36.01 What's this "serialization" thing all about? What’s this “serialization” thing all about?
36.02 How do I select the best serialization technique? How do I select the best serialization technique?
36.03 How do I decide whether to serialize to human-readable ("text") or non-human-readable ("binary") format? How do I decide whether to serialize to human-readable (“text”) or non-human-readable (“binary”) format?
36.04 How do I serialize/unserialize simple types like numbers, characters, strings, etc.? How do I serialize/unserialize simple types like numbers, characters, strings, etc.?
36.05 How exactly do I read/write simple types in human-readable ("text") format? How exactly do I read/write simple types in human-readable (“text”) format?
36.06 How exactly do I read/write simple types in non-human-readable ("binary") format? How exactly do I read/write simple types in non-human-readable (“binary”) format?
36.07 How do I serialize objects that aren't part of an inheritance hierarchy and that don't contain pointers to other objects? How do I serialize objects that aren’t part of an inheritance hierarchy and that don’t contain pointers to other objects?
36.08 How do I serialize objects that are part of an inheritance hierarchy and that don't contain pointers to other objects? How do I serialize objects that are part of an inheritance hierarchy and that don’t contain pointers to other objects?
36.09 How do I serialize objects that contain pointers to other objects, but those pointers form a tree with no cycles and no joins? How do I serialize objects that contain pointers to other objects, but those pointers form a tree with no cycles and no joins?
36.10 How do I serialize objects that contain pointers to other objects, but those pointers form a tree with no cycles and only "trivial" joins? How do I serialize objects that contain pointers to other objects, but those pointers form a tree with no cycles and only “trivial” joins?
36.11 How do I serialize objects that contain pointers to other objects, and those pointers form a graph that might have cycles or non-trivial joins? How do I serialize objects that contain pointers to other objects, and those pointers form a graph that might have cycles or non-trivial joins?
36.12 Are there any caveats when serializing / unserializing objects? Are there any caveats when serializing / unserializing objects?
36.13 What's all this about graphs, trees, nodes, cycles, joins, and joins at the leaves vs. internal nodes? What’s all this about graphs, trees, nodes, cycles, joins, and joins at the leaves vs. internal nodes?
37 Class libraries
37.01 What is the "STL"? What is the “STL”?
37.02 Where can I get a copy of "STL"? Where can I get a copy of “STL”?
37.03 How can I find a Fred object in an STL container of Fred* such as std::vector<Fred*>? How can I find a Fred object in an STL container of Fred* such as std::vector<Fred*>?
37.04 Where can I get help on how to use STL? Where can I get help on how to use STL?
37.05 How can you tell if you have a dynamically typed C++ class library? How can you tell if you have a dynamically typed C++ class library?
37.06 What is the NIHCL? Where can I get it? What is the NIHCL? Where can I get it?
37.07 Where can I ftp the code that accompanies "Numerical Recipes"? Where can I ftp the code that accompanies “Numerical Recipes”?
37.08 Why is my executable so large? Why is my executable so large?
37.09 Where can I get tons and tons of more information on C++ class libraries? Where can I get tons and tons of more information on C++ class libraries?
38 Compiler dependencies
38.01 Where can I download a free C++ compiler? Where can I download a free C++ compiler?
38.02 Where can I get more information on using MFC and Visual C++? Where can I get more information on using MFC and Visual C++?
38.03 How do I display text in the status bar using MFC? How do I display text in the status bar using MFC?
38.04 How can I decompile an executable program back into C++ source code? How can I decompile an executable program back into C++ source code?
38.05 Where can I get information about the C++ compiler from {Borland, IBM, Microsoft, Sun, etc.}? Where can I get information about the C++ compiler from {Borland, IBM, Microsoft, Sun, etc.}?
38.06 What's the difference between C++ and Visual C++? What’s the difference between C++ and Visual C++?
38.07 How do compilers use "over-allocation" to remember the number of elements in an allocated array? How do compilers use “over-allocation” to remember the number of elements in an allocated array?
38.08 How do compilers use an "associative array" to remember the number of elements in an allocated array? How do compilers use an “associative array” to remember the number of elements in an allocated array?
38.09 If name mangling was standardized, could I link code compiled with compilers from different compiler vendors? If name mangling was standardized, could I link code compiled with compilers from different compiler vendors?
38.10 GNU C++ (g++) produces big executables for tiny programs; Why? GNU C++ (g++) produces big executables for tiny programs; Why?
38.11 Is there a yacc-able C++ grammar? Is there a yacc-able C++ grammar?
38.12 What is C++ 1.2? 2.0? 2.1? 3.0? What is C++ 1.2? 2.0? 2.1? 3.0?
38.13 Is it possible to convert C++ to C? Is it possible to convert C++ to C?
39 Miscellaneous technical issues
39.01 How do I convert a value (a number, for example) to a std::string? How do I convert a value (a number, for example) to a std::string?
39.02 How do I convert a std::string to a number? How do I convert a std::string to a number?
39.03 Can I templatize the above functions so they work with other types? Can I templatize the above functions so they work with other types?
39.04 What should be done with macros that contain if? What should be done with macros that contain if?
39.05 What should be done with macros that have multiple lines? What should be done with macros that have multiple lines?
39.06 What should be done with macros that need to paste two tokens together? Updated! What should be done with macros that need to paste two tokens together?
39.07 Why can't the compiler find my header file in #include "c:\test.h" ? Why can’t the compiler find my header file in #include "c:\test.h" ?
39.08 What are the C++ scoping rules for for loops? What are the C++ scoping rules for for loops?
39.09 Why can't I overload a function by its return type? Why can’t I overload a function by its return type?
39.10 What is "persistence"? What is a "persistent object"? What is “persistence”? What is a “persistent object”?
39.11 How can I create two classes that both know about each other? How can I create two classes that both know about each other?
39.12 What special considerations are needed when forward declarations are used with member objects? What special considerations are needed when forward declarations are used with member objects?
39.13 What special considerations are needed when forward declarations are used with inline functions? What special considerations are needed when forward declarations are used with inline functions?
39.14 Why can't I put a forward-declared class in a std::vector<>? Why can’t I put a forward-declared class in a std::vector<>?
39.15 Why do some people think x = ++y + y++ is bad? Why do some people think x = ++y + y++ is bad?
39.16 What's the deal with "sequence points"? What’s the deal with “sequence points”?
40 Miscellaneous environmental issues
40.01 How can I generate HTML documentation for my classes? Does C++ have anything similar to javadoc? How can I generate HTML documentation for my classes? Does C++ have anything similar to javadoc?
40.02 Is there a TeX or LaTeX macro that fixes the spacing on "C++"? Is there a TeX or LaTeX macro that fixes the spacing on “C++”?
40.03 Are there any pretty-printers that reformat C++ source code? Are there any pretty-printers that reformat C++ source code?
40.04 Is there a C++-mode for GNU emacs? If so, where can I get it? Is there a C++-mode for GNU emacs? If so, where can I get it?
40.05 Where can I get OS-specific questions answered (e.g., BC++, Windows, etc)? Where can I get OS-specific questions answered (e.g., BC++, Windows, etc)?
40.06 Why does my DOS C++ program says "Sorry: floating point code not linked"? Why does my DOS C++ program says “Sorry: floating point code not linked”?
40.07 Why does my BC++ Windows app crash when I'm not running the BC45 IDE? Why does my BC++ Windows app crash when I’m not running the BC45 IDE?