You are not allowed to edit this page. <!-- File: id-defns Defines IDs for each FAQ and section. Rule: FAQ editors should always use these IDs for every internal cross-reference within the FAQ. Always use indirect links ('[description][id-of-target]') when linking to the FAQ from within the FAQ. Never use direct links ('[description](url-of-target)') when linking to the FAQ from within the FAQ. Reason: The FAQ is a living document -- we will split/join sections and move FAQs between sections. Those changes result in changes to the URL of the moved FAQs, which breaks all direct links -- many changes. However using indirect links means we need only change one thing in one place: this id-defns file. Caveat: This rule applies only to internal cross-reference links, not to links to resources outside the FAQ. E.g., if you are making a link from FAQ 'x' to FAQ 'y', then you should always use FAQ 'y's link-ID. However if you are making a link from FAQ 'x' to some resource outside the FAQ, you have two choices: You can use a direct link to the external resource's URL ('[description](url-of-external-resource)'), or you can add the external resource to this file then link indirectly ('[description][id-of-external-resource]'). Typically you would do the latter only when the FAQ contains more than one link to that external resource. --> <!-- special resources --> [id-defns]: /wiki/faq/id-defns "ID definitions master file" [broken-link]: /wiki/faq/broken-link "Want to help? Send the correct link. Thanks!" [email-editors]: mailto:faq-discussion@isocpp.org "Email the FAQ Editors" [faq-icon]: /themes/wiki_themes/isocpp/images/faq-12.png "FAQ" [permalink-icon]: /themes/wiki_themes/isocpp/images/permalink.png "Permalink" [smile-image]: /themes/wiki_themes/isocpp/images/smile.gif "SMILE!" <!-- /wiki/faq/index = 'C++ FAQ' --> [index]: /wiki/faq/index "C++ FAQ" <!-- /wiki/faq/big-picture = 'Big Picture Issues' --> [big-picture]: /wiki/faq/big-picture "Section: Big Picture Issues" [what-is-cpp]: /wiki/faq/big-picture#what-is-cpp "FAQ: What is C++?" [practical-language]: /wiki/faq/big-picture#practical-language "FAQ: Is C++ a practical language?" [imperfect-language]: /wiki/faq/big-picture#imperfect-language "FAQ: Is C++ a perfect language?" [why-classes]: /wiki/faq/big-picture#why-classes "FAQ: What's so great about classes?" [why-use-oo]: /wiki/faq/big-picture#why-use-oo "FAQ: What's the big deal with OO?" [generic-paradigm]: /wiki/faq/big-picture#generic-paradigm "FAQ: What's the big deal with generic programming?" [multiparadigm-programming]: /wiki/faq/big-picture#multiparadigm-programming "FAQ: What is multiparadigm programming?" [lang-comparisons]: /wiki/faq/big-picture#lang-comparisons "FAQ: Is C++ better than Java? (or Visual Basic, C, Objective-C, FORTRAN, Pascal, Ada, Smalltalk, or any other language?)" [why-so-big]: /wiki/faq/big-picture#why-so-big "FAQ: Why is C++ so big?" [who-uses-cpp]: /wiki/faq/big-picture#who-uses-cpp "FAQ: Who uses C++?" [time-to-learn]: /wiki/faq/big-picture#time-to-learn "FAQ: How long does it take to learn OO/C++?" [improve-programs]: /wiki/faq/big-picture#improve-programs "FAQ: What's the best way to improve my C++ programs?" [which-language]: /wiki/faq/big-picture#which-language "FAQ: Does it matter which programming language I use?" [overview-cpp]: /wiki/faq/big-picture#overview-cpp "FAQ: What are some features of C++ from a business perspective?" [virt-is-central-to-oo]: /wiki/faq/big-picture#virt-is-central-to-oo "FAQ: Are virtual functions (dynamic binding) central to OO/C++?" [old-code-can-call-new-code]: /wiki/faq/big-picture#old-code-can-call-new-code "FAQ: I'm from Missouri. Can you give me a simple reason why virtual functions (dynamic binding) make a big difference?" [back-compat-with-c]: /wiki/faq/big-picture#back-compat-with-c "FAQ: Is C++ backward compatible with ANSI/ISO C?" [why-compat-with-c]: /wiki/faq/big-picture#why-compat-with-c "FAQ: Why is C++ (almost) compatible with C?" [when-invented]: /wiki/faq/big-picture#when-invented "FAQ: When was C++ invented?" [why-invented]: /wiki/faq/big-picture#why-invented "FAQ: Why was C++ invented?" [why-name]: /wiki/faq/big-picture#why-name "FAQ: Where did the name C++ come from?" [unsafe-code]: /wiki/faq/big-picture#unsafe-code "FAQ: Why does C++ allow unsafe code?" [undefined]: /wiki/faq/big-picture#undefined "FAQ: Why are some things left undefined in C++?" [portability]: /wiki/faq/big-picture#portability "FAQ: Why is portability considered so important?" [standardization]: /wiki/faq/big-picture#standardization "FAQ: Is C++ standardized?" [copy-of-standard]: /wiki/faq/big-picture#copy-of-standard "FAQ: Where can I get a copy of the ANSI/ISO C++ standard?" [cpp98-to-cpp03]: /wiki/faq/big-picture#cpp98-to-cpp03 "FAQ: What is the difference between C++98 and C++03?" [cpp98-to-cpp0x]: /wiki/faq/big-picture#cpp98-to-cpp0x "FAQ: What is the difference between C++98 and C++0x?" [cpp98-to-cpp11]: /wiki/faq/big-picture#cpp98-to-cpp11 "FAQ: What is the difference between C++98 and C++11?" [cpp11-to-cpp14]: /wiki/faq/big-picture#cpp11-to-cpp14 "FAQ: What is the difference between C++11 and C++14?" [interview-questions]: /wiki/faq/big-picture#interview-questions "FAQ: What are some 'interview questions' I could ask that would let me know if candidates really know their stuff?" [defn-evil]: /wiki/faq/big-picture#defn-evil "FAQ: What does the FAQ mean by 'such and such is evil'?" [use-evil-things-sometimes]: /wiki/faq/big-picture#use-evil-things-sometimes "FAQ: Will I sometimes use any so-called 'evil' constructs?" [biz-dominates-tech]: /wiki/faq/big-picture#biz-dominates-tech "FAQ: Is it important to know the technical definition of 'good OO'? Of 'good class design'?" [faq-moniker-not-acronym]: /wiki/faq/big-picture#faq-moniker-not-acronym "FAQ: 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?" <!-- /wiki/faq/classes-and-objects = 'Classes and Objects' --> [classes-and-objects]: /wiki/faq/classes-and-objects "Section: Classes and Objects" [overview-class]: /wiki/faq/classes-and-objects#overview-class "FAQ: What is a class?" [overview-object]: /wiki/faq/classes-and-objects#overview-object "FAQ: What is an object?" [good-interfaces]: /wiki/faq/classes-and-objects#good-interfaces "FAQ: When is an interface 'good'?" [encapsulation]: /wiki/faq/classes-and-objects#encapsulation "FAQ: What is encapsulation?" [safety-vs-usability]: /wiki/faq/classes-and-objects#safety-vs-usability "FAQ: How does C++ help with the tradeoff of safety vs. usability?" [encap-is-for-code-not-people]: /wiki/faq/classes-and-objects#encap-is-for-code-not-people "FAQ: How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?" [directly-access-private-in-other-instances]: /wiki/faq/classes-and-objects#directly-access-private-in-other-instances "FAQ: Can a method directly access the non-public members of another instance of its class?" [encap-is-not-security]: /wiki/faq/classes-and-objects#encap-is-not-security "FAQ: Is Encapsulation a Security device?" [struct-vs-class]: /wiki/faq/classes-and-objects#struct-vs-class "FAQ: What's the difference between the keywords struct and class?" [in-class-constant]: /wiki/faq/classes-and-objects#in-class-constant "FAQ: How do I define an in-class constant?" [data-in-class]: /wiki/faq/classes-and-objects#data-in-class "FAQ: Why do I have to put the data in my class declarations?" [layout-obj]: /wiki/faq/classes-and-objects#layout-obj "FAQ: How are C++ objects laid out in memory?" [sizeof-empty]: /wiki/faq/classes-and-objects#sizeof-empty "FAQ: Why is the size of an empty class not zero?" <!-- /wiki/faq/references = 'References' --> [references]: /wiki/faq/references "Section: References" [overview-refs]: /wiki/faq/references#overview-refs "FAQ: What is a reference?" [assigning-refs]: /wiki/faq/references#assigning-refs "FAQ: What happens if you assign to a reference?" [returning-refs]: /wiki/faq/references#returning-refs "FAQ: What happens if you return a reference?" [method-chaining]: /wiki/faq/references#method-chaining "FAQ: What does object.method1().method2() mean?" [reseating-refs]: /wiki/faq/references#reseating-refs "FAQ: How can you reseat a reference to make it refer to a different object?" [pointers-and-references]: /wiki/faq/references#pointers-and-references "FAQ: Why does C++ have both pointers and references?" [refs-vs-ptrs]: /wiki/faq/references#refs-vs-ptrs "FAQ: When should I use references, and when should I use pointers?" [refs-not-null]: /wiki/faq/references#refs-not-null "FAQ: What does it mean that a reference must refer to an object, not a dereferenced null pointer?" [what-is-a-handle]: /wiki/faq/references#what-is-a-handle "FAQ: 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?" [call-by-reference]: /wiki/faq/references#call-by-reference "FAQ: Should I use call-by-value or call-by-reference?" [this-not-reference]: /wiki/faq/references#this-not-reference "FAQ: Why is this not a reference?" <!-- /wiki/faq/inline-functions = 'Inline Functions' --> [inline-functions]: /wiki/faq/inline-functions "Section: Inline Functions" [overview-inline-fns]: /wiki/faq/inline-functions#overview-inline-fns "FAQ: What's the deal with inline functions?" [procedural-integration]: /wiki/faq/inline-functions#procedural-integration "FAQ: What's a simple example of procedural integration?" [inline-and-perf]: /wiki/faq/inline-functions#inline-and-perf "FAQ: Do inline functions improve performance?" [safety-vs-speed]: /wiki/faq/inline-functions#safety-vs-speed "FAQ: How can inline functions help with the tradeoff of safety vs. speed?" [inline-vs-macros]: /wiki/faq/inline-functions#inline-vs-macros "FAQ: Why should I use inline functions instead of plain old #define macros?" [inline-nonmember-fns]: /wiki/faq/inline-functions#inline-nonmember-fns "FAQ: How do you tell the compiler to make a non-member function inline?" [inline-member-fns]: /wiki/faq/inline-functions#inline-member-fns "FAQ: How do you tell the compiler to make a member function inline?" [inline-member-fns-more]: /wiki/faq/inline-functions#inline-member-fns-more "FAQ: Is there another way to tell the compiler to make a member function inline?" [where-to-put-inline-keyword]: /wiki/faq/inline-functions#where-to-put-inline-keyword "FAQ: 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?" <!-- /wiki/faq/ctors = 'Constructors' --> [ctors]: /wiki/faq/ctors "Section: Constructors" [overview-ctors]: /wiki/faq/ctors#overview-ctors "FAQ: What's the deal with constructors?" [empty-parens-in-object-decl]: /wiki/faq/ctors#empty-parens-in-object-decl "FAQ: Is there any difference between List x; and List x();?" [init-methods]: /wiki/faq/ctors#init-methods "FAQ: Can one constructor of a class call another constructor of the same class to initialize the this object?" [default-ctor]: /wiki/faq/ctors#default-ctor "FAQ: Is the default constructor for Fred always Fred::Fred()?" [arrays-call-default-ctor]: /wiki/faq/ctors#arrays-call-default-ctor "FAQ: Which constructor gets called when I create an array of Fred objects?" [init-lists]: /wiki/faq/ctors#init-lists "FAQ: Should my constructors use 'initialization lists' or 'assignment'?" [ctor-initializer-order]: /wiki/faq/ctors#ctor-initializer-order "FAQ: How should initializers be ordered in a constructor's initialization list?" [initializing-members-from-other-members]: /wiki/faq/ctors#initializing-members-from-other-members "FAQ: Is it moral for one member object to be initialized using another member object in the initializer expression?" [order-dependency-in-members]: /wiki/faq/ctors#order-dependency-in-members "FAQ: What if one member object has to be initialized using another member object?" [using-this-in-ctors]: /wiki/faq/ctors#using-this-in-ctors "FAQ: Should you use the this pointer in the constructor?" [named-ctor-idiom]: /wiki/faq/ctors#named-ctor-idiom "FAQ: What is the 'Named Constructor Idiom'?" [return-by-value-optimization]: /wiki/faq/ctors#return-by-value-optimization "FAQ: Does return-by-value mean extra copies and extra overhead?" [return-local-var-by-value-optimization]: /wiki/faq/ctors#return-local-var-by-value-optimization "FAQ: What about returning a local variable by value? Does the local exist as a separate object, or does it get optimized away?" [explicit-define-static-data-mems]: /wiki/faq/ctors#explicit-define-static-data-mems "FAQ: Why can't I initialize my static member data in my constructor's initialization list?" [link-errs-static-data-mems]: /wiki/faq/ctors#link-errs-static-data-mems "FAQ: Why are classes with static data members getting linker errors?" [static-const-with-initializers]: /wiki/faq/ctors#static-const-with-initializers "FAQ: Can I add = initializer; to the declaration of a class-scope static const data member?" [static-init-order]: /wiki/faq/ctors#static-init-order "FAQ: What's the 'static initialization order fiasco'?" [static-init-order-on-first-use]: /wiki/faq/ctors#static-init-order-on-first-use "FAQ: How do I prevent the 'static initialization order fiasco'?" [construct-on-first-use-v2]: /wiki/faq/ctors#construct-on-first-use-v2 "FAQ: Why doesn't the Construct On First Use Idiom use a static object instead of a static pointer?" [nifty-counter-idiom]: /wiki/faq/ctors#nifty-counter-idiom "FAQ: What is a technique to guarantee both static initialization and static deinitialization?" [static-init-order-on-first-use-members]: /wiki/faq/ctors#static-init-order-on-first-use-members "FAQ: How do I prevent the 'static initialization order fiasco' for my static data members?" [static-init-order-on-intrinsics]: /wiki/faq/ctors#static-init-order-on-intrinsics "FAQ: Do I need to worry about the 'static initialization order fiasco' for variables of built-in/intrinsic types?" [ctors-can-throw2]: /wiki/faq/ctors#ctors-can-throw2 "FAQ: How can I handle a constructor that fails?" [named-parameter-idiom]: /wiki/faq/ctors#named-parameter-idiom "FAQ: What is the 'Named Parameter Idiom'?" [fn-decl-vs-obj-instantiation]: /wiki/faq/ctors#fn-decl-vs-obj-instantiation "FAQ: Why am I getting an error after declaring a Foo object via Foo x(Bar())?" [explicit-ctors]: /wiki/faq/ctors#explicit-ctors "FAQ: What is the purpose of the explicit keyword?" [ctor-work-right]: /wiki/faq/ctors#ctor-work-right "FAQ: Why doesn't my constructor work right?" <!-- /wiki/faq/dtors = 'Destructors' --> [dtors]: /wiki/faq/dtors "Section: Destructors" [overview-dtors]: /wiki/faq/dtors#overview-dtors "FAQ: What's the deal with destructors?" [order-dtors-for-locals]: /wiki/faq/dtors#order-dtors-for-locals "FAQ: What's the order that local objects are destructed?" [order-dtors-for-arrays]: /wiki/faq/dtors#order-dtors-for-arrays "FAQ: What's the order that objects in an array are destructed?" [cant-overload-dtors]: /wiki/faq/dtors#cant-overload-dtors "FAQ: Can I overload the destructor for my class?" [dont-call-dtor-on-local]: /wiki/faq/dtors#dont-call-dtor-on-local "FAQ: Should I explicitly call a destructor on a local variable?" [dont-call-dtor-on-local-really]: /wiki/faq/dtors#dont-call-dtor-on-local-really "FAQ: 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?" [artificial-block-to-control-lifetimes]: /wiki/faq/dtors#artificial-block-to-control-lifetimes "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?" [dtor-like-method-to-control-lifetimes]: /wiki/faq/dtors#dtor-like-method-to-control-lifetimes "FAQ: What if I can't wrap the local in an artificial block?" [dont-call-dtor-on-obj-allocd-via-new]: /wiki/faq/dtors#dont-call-dtor-on-obj-allocd-via-new "FAQ: But can I explicitly call a destructor if I've allocated my object with new?" [placement-new]: /wiki/faq/dtors#placement-new "FAQ: What is 'placement new' and why would I use it?" [placement-delete]: /wiki/faq/dtors#placement-delete "FAQ: Is there a placement delete?" [calling-member-dtors]: /wiki/faq/dtors#calling-member-dtors "FAQ: When I write a destructor, do I need to explicitly call the destructors for my member objects?" [calling-base-dtor]: /wiki/faq/dtors#calling-base-dtor "FAQ: When I write a derived class's destructor, do I need to explicitly call the destructor for my base class?" [exceptions-in-dtor]: /wiki/faq/dtors#exceptions-in-dtor "FAQ: Should my destructor throw an exception when it detects a problem?" [memory-pools]: /wiki/faq/dtors#memory-pools "FAQ: Is there a way to force new to allocate memory from a specific memory area?" <!-- /wiki/faq/assignment-operators = 'Assignment Operators' --> [assignment-operators]: /wiki/faq/assignment-operators "Section: Assignment Operators" [self-assignment-what]: /wiki/faq/assignment-operators#self-assignment-what "FAQ: What is 'self assignment'?" [self-assignment-why]: /wiki/faq/assignment-operators#self-assignment-why "FAQ: Why should I worry about 'self assignment'?" [self-assignment-how]: /wiki/faq/assignment-operators#self-assignment-how "FAQ: Okay, okay, already; I'll handle self-assignment. How do I do it?" [assignment-op-in-derived-class]: /wiki/faq/assignment-operators#assignment-op-in-derived-class "FAQ: I'm creating a derived class; should my assignment operator call my base class's assignment operator?" <!-- /wiki/faq/operator-overloading = 'Operator Overloading' --> [operator-overloading]: /wiki/faq/operator-overloading "Section: Operator Overloading" [overview-op-ov]: /wiki/faq/operator-overloading#overview-op-ov "FAQ: What's the deal with operator overloading?" [op-ov-benefits]: /wiki/faq/operator-overloading#op-ov-benefits "FAQ: What are the benefits of operator overloading?" [op-ov-examples]: /wiki/faq/operator-overloading#op-ov-examples "FAQ: What are some examples of operator overloading?" [op-ov-not-for-class-builder]: /wiki/faq/operator-overloading#op-ov-not-for-class-builder "FAQ: But operator overloading makes my class look ugly; isn't it supposed to make my code clearer?" [overloadable-opers]: /wiki/faq/operator-overloading#overloadable-opers "FAQ: What operators can/cannot be overloaded?" [overload-dot]: /wiki/faq/operator-overloading#overload-dot "FAQ: Why can't I overload . (dot), ::, sizeof, etc.?" [overload-operator]: /wiki/faq/operator-overloading#overload-operator "FAQ: Can I define my own operators?" [cant-replace-ops-on-built-ins]: /wiki/faq/operator-overloading#cant-replace-ops-on-built-ins "FAQ: Can I overload operator== so it lets me compare two char[] using a string comparison?" [creating-new-opers]: /wiki/faq/operator-overloading#creating-new-opers "FAQ: Can I create a operator** for 'to-the-power-of' operations?" [law-of-least-surprise-op-ov]: /wiki/faq/operator-overloading#law-of-least-surprise-op-ov "FAQ: The previous FAQs tell me which operators I can override; but which operators should I override?" [op-ov-rules]: /wiki/faq/operator-overloading#op-ov-rules "FAQ: What are some guidelines / 'rules of thumb' for overloading operators?" [matrix-subscript-op]: /wiki/faq/operator-overloading#matrix-subscript-op "FAQ: How do I create a subscript operator for a Matrix class?" [matrix-array-of-array]: /wiki/faq/operator-overloading#matrix-array-of-array "FAQ: Why shouldn't my Matrix class's interface look like an array-of-array?" [matrix-c-style-subscript]: /wiki/faq/operator-overloading#matrix-c-style-subscript "FAQ: I still don't get it. Why shouldn't my Matrix class's interface look like an array-of-array?" [design-interfaces-first]: /wiki/faq/operator-overloading#design-interfaces-first "FAQ: Should I design my classes from the outside (interfaces first) or from the inside (data first)?" [increment-pre-post-overloading]: /wiki/faq/operator-overloading#increment-pre-post-overloading "FAQ: How can I overload the prefix and postfix forms of operators ++ and --?" [increment-pre-post-speed]: /wiki/faq/operator-overloading#increment-pre-post-speed "FAQ: Which is more efficient: i++ or ++i?" <!-- /wiki/faq/friends = 'Friends' --> [friends]: /wiki/faq/friends "Section: Friends" [overview-friends]: /wiki/faq/friends#overview-friends "FAQ: What is a friend?" [friends-and-encap]: /wiki/faq/friends#friends-and-encap "FAQ: Do friends violate encapsulation?" [pros-cons-friend-fns]: /wiki/faq/friends#pros-cons-friend-fns "FAQ: What are some advantages/disadvantages of using friend functions?" [friendship-not-inherited-transitive]: /wiki/faq/friends#friendship-not-inherited-transitive "FAQ: What does it mean that 'friendship isn't inherited, transitive, or reciprocal'?" [member-vs-friend-fns]: /wiki/faq/friends#member-vs-friend-fns "FAQ: Should my class declare a member function or a friend function?" <!-- /wiki/faq/input-output = 'Input/output via <iostream> and <cstdio>' --> [input-output]: /wiki/faq/input-output "Section: Input/output via <iostream> and <cstdio>" [iostream-vs-stdio]: /wiki/faq/input-output#iostream-vs-stdio "FAQ: Why should I use <iostream> instead of the traditional <cstdio>?" [stream-input-failure]: /wiki/faq/input-output#stream-input-failure "FAQ: Why does my program go into an infinite loop when someone enters an invalid input character?" [istream-and-ignore]: /wiki/faq/input-output#istream-and-ignore "FAQ: How can I get std::cin to skip invalid input characters?" [istream-and-while]: /wiki/faq/input-output#istream-and-while "FAQ: How does that funky while (std::cin >> foo) syntax work?" [istream-and-eof]: /wiki/faq/input-output#istream-and-eof "FAQ: Why does my input seem to process past the end of file?" [istreams-remember-bad-state]: /wiki/faq/input-output#istreams-remember-bad-state "FAQ: Why is my program ignoring my input request after the first iteration?" [endl-vs-slash-n]: /wiki/faq/input-output#endl-vs-slash-n "FAQ: Should I end my output lines with std::endl or '\n'?" [output-operator]: /wiki/faq/input-output#output-operator "FAQ: How can I provide printing for my class Fred?" [output-operator-via-friends]: /wiki/faq/input-output#output-operator-via-friends "FAQ: But shouldn't I always use a printOn() method rather than a friend function?" [input-operator]: /wiki/faq/input-output#input-operator "FAQ: How can I provide input for my class Fred?" [virtual-friend-fns]: /wiki/faq/input-output#virtual-friend-fns "FAQ: How can I provide printing for an entire hierarchy of classes?" [binary-mode-for-iostreams]: /wiki/faq/input-output#binary-mode-for-iostreams "FAQ: How can I open a stream in binary mode?" [binary-mode-for-cin-cout]: /wiki/faq/input-output#binary-mode-for-cin-cout "FAQ: How can I 'reopen' std::cin and std::cout in binary mode?" [serialization-xref-file]: /wiki/faq/input-output#serialization-xref-file "FAQ: How can I write/read objects of my class to/from a data file?" [serialization-xref-communication]: /wiki/faq/input-output#serialization-xref-communication "FAQ: How can I send objects of my class to another computer (e.g., via a socket, TCP/IP, FTP, email, a wireless link, etc.)?" [backslashes-in-filenames]: /wiki/faq/input-output#backslashes-in-filenames "FAQ: Why can't I open a file in a different directory such as '..\test.dat'?" [kbhit]: /wiki/faq/input-output#kbhit "FAQ: How can I tell (if a key, which key) was pressed before the user presses the ENTER key?" [turn-off-tty-echo]: /wiki/faq/input-output#turn-off-tty-echo "FAQ: How can I make it so keys pressed by users are not echoed on the screen?" [move-cursor-on-screen]: /wiki/faq/input-output#move-cursor-on-screen "FAQ: How can I move the cursor around on the screen?" [clear-screen]: /wiki/faq/input-output#clear-screen "FAQ: How can I clear the screen? Is there something like clrscr()?" [change-screen-colors]: /wiki/faq/input-output#change-screen-colors "FAQ: How can I change the colors on the screen?" [print-char-or-ptr-as-number]: /wiki/faq/input-output#print-char-or-ptr-as-number "FAQ: How can I print a char as a number? How can I print a char* so the output shows the pointer's numeric value?" <!-- /wiki/faq/freestore-mgmt = 'Memory Management' --> [freestore-mgmt]: /wiki/faq/freestore-mgmt "Section: Memory Management" [memory-leaks]: /wiki/faq/freestore-mgmt#memory-leaks "FAQ: How do I deal with memory leaks?" [new-java]: /wiki/faq/freestore-mgmt#new-java "FAQ: Can I use new just as in Java?" [null-or-zero]: /wiki/faq/freestore-mgmt#null-or-zero "FAQ: Should I use NULL or 0 or nullptr?" [delete-p-doesnt-delete-p]: /wiki/faq/freestore-mgmt#delete-p-doesnt-delete-p "FAQ: Does delete p delete the pointer p, or the pointed-to-data *p?" [double-delete-disaster]: /wiki/faq/freestore-mgmt#double-delete-disaster "FAQ: Is it safe to delete the same pointer twice?" [mixing-malloc-and-delete]: /wiki/faq/freestore-mgmt#mixing-malloc-and-delete "FAQ: Can I free() pointers allocated with new? Can I delete pointers allocated with malloc()?" [new-malloc-diff]: /wiki/faq/freestore-mgmt#new-vs-malloc "FAQ: What is the difference between new and malloc()?" [new-vs-malloc]: /wiki/faq/freestore-mgmt#new-vs-malloc "FAQ: Why should I use new instead of trustworthy old malloc()?" [realloc-and-renew]: /wiki/faq/freestore-mgmt#realloc-and-renew "FAQ: Can I use realloc() on pointers allocated via new?" [renew]: /wiki/faq/freestore-mgmt#renew "FAQ: Why doesn't C++ have an equivalent to realloc()?" [new-never-returns-null]: /wiki/faq/freestore-mgmt#new-never-returns-null "FAQ: Do I need to check for null after p = new Fred()?" [making-new-check-for-null]: /wiki/faq/freestore-mgmt#making-new-check-for-null "FAQ: How can I convince my (older) compiler to automatically check new to see if it returns null?" [delete-handles-null]: /wiki/faq/freestore-mgmt#delete-handles-null "FAQ: Do I need to check for null before delete p?" [two-steps-of-delete]: /wiki/faq/freestore-mgmt#two-steps-of-delete "FAQ: What are the two steps that happen when I say delete p?" [delete-zero]: /wiki/faq/freestore-mgmt#delete-zero "FAQ: Why doesn't delete null out its operand?" [delete-scope]: /wiki/faq/freestore-mgmt#delete-scope "FAQ: Why isn't the destructor called at the end of scope?" [new-doesnt-leak-if-ctor-throws]: /wiki/faq/freestore-mgmt#new-doesnt-leak-if-ctor-throws "FAQ: In p = new Fred(), does the Fred memory 'leak' if the Fred constructor throws an exception?" [allocate-array]: /wiki/faq/freestore-mgmt#allocate-array "FAQ: How do I allocate / unallocate an array of things?" [delete-array]: /wiki/faq/freestore-mgmt#delete-array "FAQ: What if I forget the [] when deleteing an array allocated via new T[n]?" [delete-array-built-ins]: /wiki/faq/freestore-mgmt#delete-array-built-ins "FAQ: Can I drop the [] when deleteing an array of some built-in type (char, int, etc)?" [num-elems-in-new-array]: /wiki/faq/freestore-mgmt#num-elems-in-new-array "FAQ: After p = new Fred[n], how does the compiler know there are n objects to be destructed during delete[] p?" [delete-this]: /wiki/faq/freestore-mgmt#delete-this "FAQ: Is it legal (and moral) for a member function to say delete this?" [multidim-arrays]: /wiki/faq/freestore-mgmt#multidim-arrays "FAQ: How do I allocate multidimensional arrays using new?" [multidim-arrays2]: /wiki/faq/freestore-mgmt#multidim-arrays2 "FAQ: But the previous FAQ's code is SOOOO tricky and error prone! Isn't there a simpler way?" [multidim-arrays3]: /wiki/faq/freestore-mgmt#multidim-arrays3 "FAQ: But the above Matrix class is specific to Fred! Isn't there a way to make it generic?" [multidim-arrays4]: /wiki/faq/freestore-mgmt#multidim-arrays4 "FAQ: What's another way to build a Matrix template?" [dynamic-array-len]: /wiki/faq/freestore-mgmt#dynamic-array-len "FAQ: Does C++ have arrays whose length can be specified at run-time?" [static-create-methods]: /wiki/faq/freestore-mgmt#static-create-methods "FAQ: How can I force objects of my class to always be created via new rather than as local, namespace-scope, global, or static?" [ref-count-simple]: /wiki/faq/freestore-mgmt#ref-count-simple "FAQ: How do I do simple reference counting?" [ref-count-with-cow]: /wiki/faq/freestore-mgmt#ref-count-with-cow "FAQ: How do I provide reference counting with copy-on-write semantics?" [ref-count-with-cow-hierarchy]: /wiki/faq/freestore-mgmt#ref-count-with-cow-hierarchy "FAQ: How do I provide reference counting with copy-on-write semantics for a hierarchy of classes?" [ref-count-mistakes-vs-espionage]: /wiki/faq/freestore-mgmt#ref-count-mistakes-vs-espionage "FAQ: Can I absolutely prevent people from subverting the reference counting mechanism, and if so, should I?" [garbage-collector-basics]: /wiki/faq/freestore-mgmt#garbage-collector-basics "FAQ: Can I use a garbage collector in C++?" [garbage-collector-kinds]: /wiki/faq/freestore-mgmt#garbage-collector-kinds "FAQ: What are the two kinds of garbage collectors for C++?" [garbage-collector-more-info]: /wiki/faq/freestore-mgmt#garbage-collector-more-info "FAQ: Where can I get more info on garbage collectors for C++?" [auto-ptr]: /wiki/faq/freestore-mgmt#auto-ptr "FAQ: What is an auto_ptr and why isn't there an auto_array?" <!-- /wiki/faq/exceptions = 'Exceptions and Error Handling' --> [exceptions]: /wiki/faq/exceptions "Section: Exceptions and Error Handling" [why-exceptions]: /wiki/faq/exceptions#why-exceptions "FAQ: Why use exceptions?" [how-exceptions]: /wiki/faq/exceptions#how-exceptions "FAQ: How do I use exceptions?" [why-not-exceptions]: /wiki/faq/exceptions#why-not-exceptions "FAQ: What shouldn't I use exceptions for?" [exceptions-eliminate-ifs]: /wiki/faq/exceptions#exceptions-eliminate-ifs "FAQ: What are some ways try / catch / throw can improve software quality?" [exceptions-avoid-spreading-out-error-logic]: /wiki/faq/exceptions#exceptions-avoid-spreading-out-error-logic "FAQ: 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?" [exceptions-avoid-two-return-types]: /wiki/faq/exceptions#exceptions-avoid-two-return-types "FAQ: How do exceptions simplify my function return type and parameter types?" [exceptions-separate-good-and-bad-path]: /wiki/faq/exceptions#exceptions-separate-good-and-bad-path "FAQ: What does it mean that exceptions separate the 'good path' (or 'happy path') from the 'bad path'?" [exceptions-require-discipline]: /wiki/faq/exceptions#exceptions-require-discipline "FAQ: I'm interpreting the previous FAQs as saying exception handling is easy and simple; did I get it right?" [mindset-for-proper-use-of-eh]: /wiki/faq/exceptions#mindset-for-proper-use-of-eh "FAQ: Exception handling seems to make my life more difficult; that must mean exception handling itself is bad; clearly I'm not the problem, right??" [too-many-trycatch-blocks]: /wiki/faq/exceptions#too-many-trycatch-blocks "FAQ: I have too many try blocks; what can I do about it?" [ctor-exceptions]: /wiki/faq/exceptions#ctor-exceptions "FAQ: Can I throw an exception from a constructor? From a destructor?" [ctors-can-throw]: /wiki/faq/exceptions#ctors-can-throw "FAQ: How can I handle a constructor that fails?" [dtors-shouldnt-throw]: /wiki/faq/exceptions#dtors-shouldnt-throw "FAQ: How can I handle a destructor that fails?" [selfcleaning-members]: /wiki/faq/exceptions#selfcleaning-members "FAQ: How should I handle resources if my constructors may throw exceptions?" [use-string-not-char-ptr]: /wiki/faq/exceptions#use-string-not-char-ptr "FAQ: How do I change the string-length of an array of char to prevent memory leaks even if/when someone throws an exception?" [what-to-throw]: /wiki/faq/exceptions#what-to-throw "FAQ: What should I throw?" [what-to-catch]: /wiki/faq/exceptions#what-to-catch "FAQ: What should I catch?" [catch-by-ptr-in-mfc]: /wiki/faq/exceptions#catch-by-ptr-in-mfc "FAQ: But MFC seems to encourage the use of catch-by-pointer; should I do the same?" [throw-without-an-object]: /wiki/faq/exceptions#throw-without-an-object "FAQ: What does throw; (without an exception object after the throw keyword) mean? Where would I use it?" [throwing-polymorphically]: /wiki/faq/exceptions#throwing-polymorphically "FAQ: How do I throw polymorphically?" [num-copies-of-exception]: /wiki/faq/exceptions#num-copies-of-exception "FAQ: When I throw this object, how many times will it be copied?" [finally]: /wiki/faq/exceptions#finally "FAQ: Why doesn't C++ provide a finally construct?" [resume-exception]: /wiki/faq/exceptions#resume-exception "FAQ: Why can't I resume after catching an exception?" <!-- /wiki/faq/const-correctness = 'Const Correctness' --> [const-correctness]: /wiki/faq/const-correctness "Section: Const Correctness" [overview-const]: /wiki/faq/const-correctness#overview-const "FAQ: What is 'const correctness'?" [const-and-type-safety]: /wiki/faq/const-correctness#const-and-type-safety "FAQ: How is 'const correctness' related to ordinary type safety?" [retrofitting-const]: /wiki/faq/const-correctness#retrofitting-const "FAQ: Should I try to get things const correct 'sooner' or 'later'?" [ptr-to-const]: /wiki/faq/const-correctness#ptr-to-const "FAQ: What does 'const X* p' mean?" [const-ptr-vs-ptr-const]: /wiki/faq/const-correctness#const-ptr-vs-ptr-const "FAQ: What's the difference between 'const X* p', 'X* const p' and 'const X* const p'?" [ref-to-const]: /wiki/faq/const-correctness#ref-to-const "FAQ: What does 'const X& x' mean?" [const-ref-alt]: /wiki/faq/const-correctness#const-ref-alt "FAQ: What do 'X const& x' and 'X const* p mean?" [const-ref-nonsense]: /wiki/faq/const-correctness#const-ref-nonsense "FAQ: Does 'X& const x' make any sense?" [const-member-fns]: /wiki/faq/const-correctness#const-member-fns "FAQ: What is a 'const member function'?" [return-const-ref-from-const-memfn]: /wiki/faq/const-correctness#return-const-ref-from-const-memfn "FAQ: What is the relationship between a return-by-reference and a const member function?" [const-overloading]: /wiki/faq/const-correctness#const-overloading "FAQ: What's the deal with 'const-overloading'?" [logical-vs-physical-state]: /wiki/faq/const-correctness#logical-vs-physical-state "FAQ: How can it help me design better classes if I distinguish logical state from physical state?" [logical-vs-physical-const]: /wiki/faq/const-correctness#logical-vs-physical-const "FAQ: Should the constness of my public member functions be based on what the method does to the object's logical state, or physical state?" [mutable-data-members]: /wiki/faq/const-correctness#mutable-data-members "FAQ: What do I do if I want a const member function to make an 'invisible' change to a data member?" [const-cast-and-optimization]: /wiki/faq/const-correctness#const-cast-and-optimization "FAQ: Does const_cast mean lost optimization opportunities?" [aliasing-and-const]: /wiki/faq/const-correctness#aliasing-and-const "FAQ: Why does the compiler allow me to change an int after I've pointed at it with a const int*?" [ptr-to-const-aliasing]: /wiki/faq/const-correctness#ptr-to-const-aliasing "FAQ: Does 'const Fred* p' mean that *p can't change?" [constptrptr-conversion]: /wiki/faq/const-correctness#constptrptr-conversion "FAQ: Why am I getting an error converting a Foo** → const Foo**?" <!-- /wiki/faq/big3 = 'The Big Three' --> [big3]: /wiki/faq/big3 "Section: The Big Three" [big3-preview]: /wiki/faq/big3#big3-preview "FAQ: What is the purpose of this chapter/section?" [big3-defn]: /wiki/faq/big3#big3-defn "FAQ: What are The Big Three?" [compiler-synthesized-dtor]: /wiki/faq/big3#compiler-synthesized-dtor "FAQ: What happens when you destruct an object that doesn't explicitly declare a destructor?" [compiler-synthesized-copy-ctor]: /wiki/faq/big3#compiler-synthesized-copy-ctor "FAQ: What happens when you copy-initialize an object that doesn't explicitly declare a copy-constructor?" [compiler-synthesized-assign]: /wiki/faq/big3#compiler-synthesized-assign "FAQ: What happens when you assign an object that doesn't explicitly declare an assignment operator?" [big3-law]: /wiki/faq/big3#big3-law "FAQ: What is The Law of The Big Three?" [big3-first]: /wiki/faq/big3#big3-first "FAQ: Which of The Big Three do programmers usually add to their classes first?" [remote-ownership]: /wiki/faq/big3#remote-ownership "FAQ: What is remote ownership?" [remote-ownership-deep-copy]: /wiki/faq/big3#remote-ownership-deep-copy "FAQ: How is remote ownership special?" [remote-ownership-wo-big3]: /wiki/faq/big3#remote-ownership-wo-big3 "FAQ: What if a class owns a referent and doesn't explicitly declare all of The Big Three?" [corrupt-heap-debug]: /wiki/faq/big3#corrupt-heap-debug "FAQ: Are there clever tricks that make it easy to do postmortem debugging after corrupting memory?" [managed-ptrs]: /wiki/faq/big3#managed-ptrs "FAQ: Are there any C++ classes that help manage remote ownership?" [strict_auto_ptr]: /wiki/faq/big3#strict_auto_ptr "FAQ: Does auto_ptr enforce The Law of The Big Three and solve the problems associated with remote ownership?" [big3-exceptions]: /wiki/faq/big3#big3-exceptions "FAQ: Are there cases where some-but-not-all of The Big Three are needed?" [big3-non-inline]: /wiki/faq/big3#big3-non-inline "FAQ: Are there other circumstances where it might make sense to explicitly define The Big Three?" [bitwise-copy-is-evil]: /wiki/faq/big3#bitwise-copy-is-evil "FAQ: Why does my program crash after I use std::memcpy() to copy my objects?" [bitwise-copy-is-evil2]: /wiki/faq/big3#bitwise-copy-is-evil2 "FAQ: Is std::memcpy() okay on an object that is bitwise copyable?" [elipsis-args-use-memcpy]: /wiki/faq/big3#elipsis-args-use-memcpy "FAQ: Why do programs crash when I use variable length argument lists?" [realloc-uses-memcpy]: /wiki/faq/big3#realloc-uses-memcpy "FAQ: Why do programs crash that use realloc() to reallocate an array of objects?" <!-- /wiki/faq/basics-of-inheritance = 'Inheritance — Basics' --> [basics-of-inheritance]: /wiki/faq/basics-of-inheritance "Section: Inheritance — Basics" [importance-of-inherit]: /wiki/faq/basics-of-inheritance#importance-of-inherit "FAQ: Is inheritance important to C++?" [when-to-use-inherit]: /wiki/faq/basics-of-inheritance#when-to-use-inherit "FAQ: When would I use inheritance?" [how-to-code-inherit]: /wiki/faq/basics-of-inheritance#how-to-code-inherit "FAQ: How do you express inheritance in C++?" [derivedptr-to-baseptr]: /wiki/faq/basics-of-inheritance#derivedptr-to-baseptr "FAQ: Is it okay to convert a pointer from a derived class to its base class?" [access-rules]: /wiki/faq/basics-of-inheritance#access-rules "FAQ: What's the difference between public, private, and protected?" [base-class-private]: /wiki/faq/basics-of-inheritance#base-class-private "FAQ: Why can't my derived class access private things from my base class?" [protected-interface]: /wiki/faq/basics-of-inheritance#protected-interface "FAQ: How can I protect derived classes from breaking when I change the internal parts of the base class?" [protected-data-not-evil]: /wiki/faq/basics-of-inheritance#protected-data-not-evil "FAQ: 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?" [protected-interfaces-and-roi]: /wiki/faq/basics-of-inheritance#protected-interfaces-and-roi "FAQ: Okay, so exactly how should I decide whether to build a 'protected interface'?" <!-- /wiki/faq/virtual-functions = 'Inheritance — virtual functions' --> [virtual-functions]: /wiki/faq/virtual-functions "Section: Inheritance — virtual functions" [overview-virtual-fns]: /wiki/faq/virtual-functions#overview-virtual-fns "FAQ: What is a 'virtual member function'?" [virtual-by-default]: /wiki/faq/virtual-functions#virtual-by-default "FAQ: Why are member functions not virtual by default?" [dyn-binding-and-static-typing]: /wiki/faq/virtual-functions#dyn-binding-and-static-typing "FAQ: How can C++ achieve dynamic binding yet also static typing?" [pure-virtual]: /wiki/faq/virtual-functions#pure-virtual "FAQ: What is a pure virtual function?" [dyn-binding]: /wiki/faq/virtual-functions#dyn-binding "FAQ: What's the difference between how virtual and non-virtual member functions are called?" [dyn-binding2]: /wiki/faq/virtual-functions#dyn-binding2 "FAQ: What happens in the hardware when I call a virtual function? How many layers of indirection are there? How much overhead is there?" [fully-qualified-calls-to-base]: /wiki/faq/virtual-functions#fully-qualified-calls-to-base "FAQ: How can a member function in my derived class call the same function from its base class?" [inversion]: /wiki/faq/virtual-functions#inversion "FAQ: 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?" [virtual-dtors]: /wiki/faq/virtual-functions#virtual-dtors "FAQ: When should my destructor be virtual?" [virtual-dtor-rationale]: /wiki/faq/virtual-functions#virtual-dtor-rationale "FAQ: Why are destructors not virtual by default?" [virtual-ctors]: /wiki/faq/virtual-functions#virtual-ctors "FAQ: What is a 'virtual constructor'?" [virtual-ctor-rationale]: /wiki/faq/virtual-functions#virtual-ctor-rationale "FAQ: Why don't we have virtual constructors?" <!-- /wiki/faq/proper-inheritance = 'Inheritance — Proper Inheritance and Substitutability' --> [proper-inheritance]: /wiki/faq/proper-inheritance "Section: Inheritance — Proper Inheritance and Substitutability" [hiding-inherited-public]: /wiki/faq/proper-inheritance#hiding-inherited-public "FAQ: Should I hide member functions that were public in my base class?" [derivedptrptr-to-baseptrptr]: /wiki/faq/proper-inheritance#derivedptrptr-to-baseptrptr "FAQ: Converting Derived* → Base* works okay; why doesn't Derived** → Base** work?" [parkinglot-of-car-vs-vehicle]: /wiki/faq/proper-inheritance#parkinglot-of-car-vs-vehicle "FAQ: Is a parking-lot-of-Car a kind-of parking-lot-of-Vehicle?" [array-derived-vs-base]: /wiki/faq/proper-inheritance#array-derived-vs-base "FAQ: Is an array of Derived a kind-of array of Base?" [arrays-are-covariant]: /wiki/faq/proper-inheritance#arrays-are-covariant "FAQ: Does array-of-Derived is-not-a-kind-of array-of-Base mean arrays are bad?" [circle-ellipse]: /wiki/faq/proper-inheritance#circle-ellipse "FAQ: Is a Circle a kind-of an Ellipse?" [circle-ellipse-options]: /wiki/faq/proper-inheritance#circle-ellipse-options "FAQ: Are there other options to the 'Circle is/isnot kind-of Ellipse' dilemma?" [circle-ellipse-nonintuitive]: /wiki/faq/proper-inheritance#circle-ellipse-nonintuitive "FAQ: 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?" [circle-ellipse-inversion]: /wiki/faq/proper-inheritance#circle-ellipse-inversion "FAQ: Perhaps Ellipse should inherit from Circle then?" [circle-ellipse-generalization]: /wiki/faq/proper-inheritance#circle-ellipse-generalization "FAQ: But my problem doesn't have anything to do with circles and ellipses, so what good is that silly example to me?" [circle-ellipse-behavior]: /wiki/faq/proper-inheritance#circle-ellipse-behavior "FAQ: How could 'it depend'??!? Aren't terms like 'Circle' and 'Ellipse' defined mathematically?" [sortedlist-kindof-list]: /wiki/faq/proper-inheritance#sortedlist-kindof-list "FAQ: If SortedList has exactly the same public interface as List, is SortedList a kind-of List?" <!-- /wiki/faq/abcs = 'Inheritance — Abstract Base Classes (ABCs)' --> [abcs]: /wiki/faq/abcs "Section: Inheritance — Abstract Base Classes (ABCs)" [overview-interface-vs-implem]: /wiki/faq/abcs#overview-interface-vs-implem "FAQ: What's the big deal of separating interface from implementation?" [interface-vs-implem-abcs]: /wiki/faq/abcs#interface-vs-implem-abcs "FAQ: How do I separate interface from implementation in C++ (like Modula-2)?" [abc-defn]: /wiki/faq/abcs#abc-defn "FAQ: What is an ABC?" [pure-virtual-fns]: /wiki/faq/abcs#pure-virtual-fns "FAQ: What is a 'pure virtual' member function?" [copy-of-abc-via-clone]: /wiki/faq/abcs#copy-of-abc-via-clone "FAQ: How do you define a copy constructor or assignment operator for a class that contains a pointer to a (abstract) base class?" <!-- /wiki/faq/strange-inheritance = 'Inheritance — What your mother never told you' --> [strange-inheritance]: /wiki/faq/strange-inheritance "Section: Inheritance — What your mother never told you" [calling-virtuals-from-base]: /wiki/faq/strange-inheritance#calling-virtuals-from-base "FAQ: Is it okay for a non-virtual function of the base class to call a virtual function?" [two-strategies-for-virtuals]: /wiki/faq/strange-inheritance#two-strategies-for-virtuals "FAQ: That last FAQ confuses me. Is it a different strategy from the other ways to use virtual functions? What's going on?" [protected-virtuals]: /wiki/faq/strange-inheritance#protected-virtuals "FAQ: Should I use protected virtuals instead of public virtuals?" [private-virtuals]: /wiki/faq/strange-inheritance#private-virtuals "FAQ: When should someone use private virtuals?" [calling-virtuals-from-ctors]: /wiki/faq/strange-inheritance#calling-virtuals-from-ctors "FAQ: 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?" [calling-virtuals-from-ctor-idiom]: /wiki/faq/strange-inheritance#calling-virtuals-from-ctor-idiom "FAQ: 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?" [calling-virtuals-from-dtors]: /wiki/faq/strange-inheritance#calling-virtuals-from-dtors "FAQ: 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?" [redefining-nonvirtuals]: /wiki/faq/strange-inheritance#redefining-nonvirtuals "FAQ: Should a derived class redefine ('override') a member function that is non-virtual in a base class?" [hiding-rule]: /wiki/faq/strange-inheritance#hiding-rule "FAQ: What's the meaning of, Warning: Derived::f(char) hides Base::f(double)?" [overload-derived]: /wiki/faq/strange-inheritance#overload-derived "FAQ: Why doesn't overloading work for derived classes?" [link-errs-missing-vtable]: /wiki/faq/strange-inheritance#link-errs-missing-vtable "FAQ: What does it mean that the 'virtual table' is an unresolved external?" [final-classes]: /wiki/faq/strange-inheritance#final-classes "FAQ: How can I set up my class so it won't be inherited from?" [final-methods]: /wiki/faq/strange-inheritance#final-methods "FAQ: How can I set up my member function so it won't be overridden in a derived class?" <!-- /wiki/faq/private-inheritance = 'Inheritance — private and protected inheritance' --> [private-inheritance]: /wiki/faq/private-inheritance "Section: Inheritance — private and protected inheritance" [overview-priv-inherit]: /wiki/faq/private-inheritance#overview-priv-inherit "FAQ: How do you express 'private inheritance'?" [priv-inherit-like-compos]: /wiki/faq/private-inheritance#priv-inherit-like-compos "FAQ: How are 'private inheritance' and 'composition' similar?" [priv-inherit-vs-compos]: /wiki/faq/private-inheritance#priv-inherit-vs-compos "FAQ: Which should I prefer: composition or private inheritance?" [derivedptr-to-private-baseptr]: /wiki/faq/private-inheritance#derivedptr-to-private-baseptr "FAQ: Should I pointer-cast from a private derived class to its base class?" [prot-vs-priv-inherit]: /wiki/faq/private-inheritance#prot-vs-priv-inherit "FAQ: How is protected inheritance related to private inheritance?" [access-rules-with-priv-inherit]: /wiki/faq/private-inheritance#access-rules-with-priv-inherit "FAQ: What are the access rules with private and protected inheritance?" <!-- /wiki/faq/multiple-inheritance = 'Inheritance — Multiple and Virtual Inheritance' --> [multiple-inheritance]: /wiki/faq/multiple-inheritance "Section: Inheritance — Multiple and Virtual Inheritance" [mi-overview]: /wiki/faq/multiple-inheritance#mi-overview "FAQ: How is this section organized?" [mi-needed]: /wiki/faq/multiple-inheritance#mi-needed "FAQ: Do we really need multiple inheritance?" [mi-not-evil]: /wiki/faq/multiple-inheritance#mi-not-evil "FAQ: I've been told that I should never use multiple inheritance. Is that right?" [mi-not-evil-2]: /wiki/faq/multiple-inheritance#mi-not-evil-2 "FAQ: So there are times when multiple inheritance isn't bad?!??" [mi-disciplines]: /wiki/faq/multiple-inheritance#mi-disciplines "FAQ: What are some disciplines for using multiple inheritance?" [mi-example]: /wiki/faq/multiple-inheritance#mi-example "FAQ: Can you provide an example that demonstrates the above guidelines?" [mi-tradeoffs]: /wiki/faq/multiple-inheritance#mi-tradeoffs "FAQ: Is there a simple way to visualize all these tradeoffs?" [mi-example-2]: /wiki/faq/multiple-inheritance#mi-example-2 "FAQ: Can you give another example to illustrate the above disciplines?" [mi-diamond]: /wiki/faq/multiple-inheritance#mi-diamond "FAQ: What is the 'dreaded diamond'?" [virtual-inheritance-where]: /wiki/faq/multiple-inheritance#virtual-inheritance-where "FAQ: Where in a hierarchy should I use virtual inheritance?" [mi-delegate-to-sister]: /wiki/faq/multiple-inheritance#mi-delegate-to-sister "FAQ: What does it mean to 'delegate to a sister class' via virtual inheritance?" [virtual-inheritance-abcs]: /wiki/faq/multiple-inheritance#virtual-inheritance-abcs "FAQ: What special considerations do I need to know about when I use virtual inheritance?" [virtual-inheritance-ctors]: /wiki/faq/multiple-inheritance#virtual-inheritance-ctors "FAQ: What special considerations do I need to know about when I inherit from a class that uses virtual inheritance?" [virtual-inheritance-casts]: /wiki/faq/multiple-inheritance#virtual-inheritance-casts "FAQ: What special considerations do I need to know about when I use a class that uses virtual inheritance?" [mi-vi-ctor-order]: /wiki/faq/multiple-inheritance#mi-vi-ctor-order "FAQ: One more time: what is the exact order of constructors in a multiple and/or virtual inheritance situation?" [mi-vi-dtor-order]: /wiki/faq/multiple-inheritance#mi-vi-dtor-order "FAQ: What is the exact order of destructors in a multiple and/or virtual inheritance situation?" <!-- /wiki/faq/intrinsic-types = 'Built-in / Intrinsic / Primitive Data Types' --> [intrinsic-types]: /wiki/faq/intrinsic-types "Section: Built-in / Intrinsic / Primitive Data Types" [sizeof-char]: /wiki/faq/intrinsic-types#sizeof-char "FAQ: Can sizeof(char) be 2 on some machines? For example, what about double-byte characters?" [sizeof-is-bytes]: /wiki/faq/intrinsic-types#sizeof-is-bytes "FAQ: What are the units of sizeof?" [character-vs-char]: /wiki/faq/intrinsic-types#character-vs-char "FAQ: Whoa, but what about machines or compilers that support multibyte characters. Are you saying that a 'character' and a char might be different?!?" [bits-per-byte]: /wiki/faq/intrinsic-types#bits-per-byte "FAQ: 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?!?" [very-large-bytes]: /wiki/faq/intrinsic-types#very-large-bytes "FAQ: Okay, I could imagine a machine with 9-bit bytes. But surely not 16-bit bytes or 32-bit bytes, right?" [bytes-review]: /wiki/faq/intrinsic-types#bytes-review "FAQ: I'm sooooo confused. Would you please go over the rules about bytes, chars, and characters one more time?" [pod-types]: /wiki/faq/intrinsic-types#pod-types "FAQ: What is a 'POD type'?" [intrinsics-and-init-lists]: /wiki/faq/intrinsic-types#intrinsics-and-init-lists "FAQ: When initializing non-static data members of built-in / intrinsic / primitive types, should I use the 'initialization list' or assignment?" [intrinsics-and-static-init]: /wiki/faq/intrinsic-types#intrinsics-and-static-init "FAQ: When initializing static data members of built-in / intrinsic / primitive types, should I worry about the 'static initialization order fiasco'?" [intrinsics-and-operator-overloading]: /wiki/faq/intrinsic-types#intrinsics-and-operator-overloading "FAQ: Can I define an operator overload that works with built-in / intrinsic / primitive types?" [intrinsics-delete-array]: /wiki/faq/intrinsic-types#intrinsics-delete-array "FAQ: When I delete an array of some built-in / intrinsic / primitive type, why can't I just say delete a instead of delete[] a?" [is-power-of-2]: /wiki/faq/intrinsic-types#is-power-of-2 "FAQ: How can I tell if an integer is a power of two without looping?" [return-from-functions]: /wiki/faq/intrinsic-types#return-from-functions "FAQ: What should be returned from a function?" <!-- /wiki/faq/coding-standards = 'Coding Standards' --> [coding-standards]: /wiki/faq/coding-standards "Section: Coding Standards" [coding-std-wars]: /wiki/faq/coding-standards#coding-std-wars "FAQ: What are some good C++ coding standards?" [coding-stds-vs-design-approaches]: /wiki/faq/coding-standards#coding-stds-vs-design-approaches "FAQ: Are coding standards necessary? Are they sufficient?" [coding-stds-cpp-vs-c]: /wiki/faq/coding-standards#coding-stds-cpp-vs-c "FAQ: Should our organization determine coding standards from our C experience?" [std-headers]: /wiki/faq/coding-standards#std-headers "FAQ: What's the difference between <xxx> and <xxx.h> headers?" [using-namespace-std]: /wiki/faq/coding-standards#using-namespace-std "FAQ: Should I use using namespace std in my code?" [ternary-op]: /wiki/faq/coding-standards#ternary-op "FAQ: Is the ?: operator evil since it can be used to create unreadable code?" [declare-near-first-use]: /wiki/faq/coding-standards#declare-near-first-use "FAQ: Should I declare locals in the middle of a function or at the top?" [src-file-ext]: /wiki/faq/coding-standards#src-file-ext "FAQ: What source-file-name convention is best? foo.cpp? foo.C? foo.cc?" [hdr-file-ext]: /wiki/faq/coding-standards#hdr-file-ext "FAQ: What header-file-name convention is best? foo.H? foo.hh? foo.hpp?" [lint-guidelines]: /wiki/faq/coding-standards#lint-guidelines "FAQ: Are there any lint-like guidelines for C++?" [pointer-casts]: /wiki/faq/coding-standards#pointer-casts "FAQ: Why do people worry so much about pointer casts and/or reference casts?" [identifier-name-conventions]: /wiki/faq/coding-standards#identifier-name-conventions "FAQ: Which is better: identifier names that_look_like_this or identifier names thatLookLikeThis?" [other-coding-stds]: /wiki/faq/coding-standards#other-coding-stds "FAQ: Are there any other sources of coding standards?" [bizarre-syntax]: /wiki/faq/coding-standards#bizarre-syntax "FAQ: Should I use 'unusual' syntax?" [global-vars]: /wiki/faq/coding-standards#global-vars "FAQ: What's a good coding standard for using global variables?" <!-- /wiki/faq/how-to-learn-cpp = 'Learning C++' --> [how-to-learn-cpp]: /wiki/faq/how-to-learn-cpp "Section: Learning C++" [mentoring]: /wiki/faq/how-to-learn-cpp#mentoring "FAQ: What is mentoring?" [learning-c-not-a-prereq]: /wiki/faq/how-to-learn-cpp#learning-c-not-a-prereq "FAQ: Should I learn C before I learn OO/C++?" [learning-objective-c-not-a-prereq]: /wiki/faq/how-to-learn-cpp#learning-objective-c-not-a-prereq "FAQ: Should I learn Objective-C before I learn OO/C++?" [start-learning]: /wiki/faq/how-to-learn-cpp#start-learning "FAQ: How do I start learning C++?" [best-book]: /wiki/faq/how-to-learn-cpp#best-book "FAQ: What is the best book to learn C++ from?" [buy-several-books]: /wiki/faq/how-to-learn-cpp#buy-several-books "FAQ: Should I buy one book, or several?" [morality-books]: /wiki/faq/how-to-learn-cpp#morality-books "FAQ: What are some best-of-breed C++ morality guides?" [legality-books]: /wiki/faq/how-to-learn-cpp#legality-books "FAQ: What are some best-of-breed C++ legality guides?" [prog-by-example-books]: /wiki/faq/how-to-learn-cpp#prog-by-example-books "FAQ: What are some best-of-breed C++ programming-by-example guides?" [design-books]: /wiki/faq/how-to-learn-cpp#design-books "FAQ: Are there other OO books that are relevant to OO/C++?" [help-with-homework]: /wiki/faq/how-to-learn-cpp#help-with-homework "FAQ: Will someone here help me with my homework?" [free-compiler]: /wiki/faq/how-to-learn-cpp#free-compiler "FAQ: Where can I get a free C++ compiler?" <!-- /wiki/faq/newbie = 'Newbie Questions & Answers' --> [newbie]: /wiki/faq/newbie "Section: Newbie Questions & Answers" [newbie-section-intro]: /wiki/faq/newbie#newbie-section-intro "FAQ: What is this 'newbie section' all about?" [newbie-start]: /wiki/faq/newbie#newbie-start "FAQ: Where do I start? Why do I feel so confused, so stupid?" [read-string]: /wiki/faq/newbie#read-string "FAQ: How do I read a string from input?" [simple-program]: /wiki/faq/newbie#simple-program "FAQ: How do I write a simple program?" [int-to-string]: /wiki/faq/newbie#int-to-string "FAQ: How do I convert an integer to a string?" [string-to-int]: /wiki/faq/newbie#string-to-int "FAQ: How do I convert a string to an integer?" [main-returns-int]: /wiki/faq/newbie#main-returns-int "FAQ: Should I use void main() or int main()?" [void-in-param-list]: /wiki/faq/newbie#void-in-param-list "FAQ: Should I use f(void) or f()?" [choosing-int-size]: /wiki/faq/newbie#choosing-int-size "FAQ: What are the criteria for choosing between short / int / long data types?" [const-variable]: /wiki/faq/newbie#const-variable "FAQ: What the heck is a const variable? Isn't that a contradiction in terms?" [const-vs-define]: /wiki/faq/newbie#const-vs-define "FAQ: Why would I use a const variable / const identifier as opposed to #define?" [preprocessor-is-evil]: /wiki/faq/newbie#preprocessor-is-evil "FAQ: Are you saying that the preprocessor is evil?" [what-is-std-lib]: /wiki/faq/newbie#what-is-std-lib "FAQ: What is the 'standard library'? What is included / excluded from it?" [whitespace-coding-stds]: /wiki/faq/newbie#whitespace-coding-stds "FAQ: How should I lay out my code? When should I use spaces, tabs, and/or newlines in my code?" [naming-numeric-literals]: /wiki/faq/newbie#naming-numeric-literals "FAQ: Is it okay if a lot of numbers appear in my code?" [numeric-literal-suffixes]: /wiki/faq/newbie#numeric-literal-suffixes "FAQ: What's the point of the L, U and f suffixes on numeric literals?" [bang-operator]: /wiki/faq/newbie#bang-operator "FAQ: I can understand the and (&&) and or (||) operators, but what's the purpose of the not (!) operator?" [comparisons-with-nan]: /wiki/faq/newbie#comparisons-with-nan "FAQ: Is !(a < b) logically the same as a >= b?" [nan]: /wiki/faq/newbie#nan "FAQ: What is this NaN thing?" [floating-pt-errs]: /wiki/faq/newbie#floating-pt-errs "FAQ: Why is floating point so inaccurate? Why doesn't this print 0.43?" [floating-point-arith]: /wiki/faq/newbie#floating-point-arith "FAQ: Why doesn't my floating-point comparison work?" [floating-point-arith2]: /wiki/faq/newbie#floating-point-arith2 "FAQ: Why is cos(x) != cos(y) even though x == y? (Or sine or tangent or log or just about any other floating point computation)" [enumeration-is-its-own-type]: /wiki/faq/newbie#enumeration-is-its-own-type "FAQ: What is the type of an enumeration such as enum Color? Is it of type int?" [enumeration-type-ops]: /wiki/faq/newbie#enumeration-type-ops "FAQ: If an enumeration type is distinct from any other type, what good is it? What can you do with it?" [newbie-more-info]: /wiki/faq/newbie#newbie-more-info "FAQ: What other 'newbie' guides are there for me?" <!-- /wiki/faq/objective-c = 'Learning C++ if you already know Objective-C' --> [objective-c]: /wiki/faq/objective-c "Section: Learning C++ if you already know Objective-C" [objective-c-diffs]: /wiki/faq/objective-c#objective-c-diffs "FAQ: What's the difference between C++ and Objective-C?" [static-typing-and-objective-c]: /wiki/faq/objective-c#static-typing-and-objective-c "FAQ: What is 'static typing,' and how is it similar/dissimilar to Objective-C?" [static-typing-and-cpp]: /wiki/faq/objective-c#static-typing-and-cpp "FAQ: Which is a better fit for C++: 'static typing' or 'dynamic typing'?" [objective-c-and-inherit]: /wiki/faq/objective-c#objective-c-and-inherit "FAQ: How do you use inheritance in C++, and is that different from Objective-C?" [objective-c-and-inherit-consequences]: /wiki/faq/objective-c#objective-c-and-inherit-consequences "FAQ: What are the practical consequences of differences in Objective-C/C++ inheritance?" <!-- /wiki/faq/c = 'Learning C++ if you already know C' --> [c]: /wiki/faq/c "Section: Learning C++ if you already know C" [c-migration]: /wiki/faq/c#c-migration "FAQ: Is it easy to migrate from C to C++?" [c-diffs]: /wiki/faq/c#c-diffs "FAQ: What's the difference between C++ and C?" [is-c-a-subset]: /wiki/faq/c#is-c-a-subset "FAQ: Is C a subset of C++?" [sort-qsort]: /wiki/faq/c#sort-qsort "FAQ: Why use sort() when we have good old qsort()?" [void-ptr]: /wiki/faq/c#void-ptr "FAQ: Why must I use a cast to convert from void*?" <!-- /wiki/faq/csharp-java = 'Learning C++ if you already know C# or Java' --> [csharp-java]: /wiki/faq/csharp-java "Section: Learning C++ if you already know C# or Java" [csharp-java-diffs]: /wiki/faq/csharp-java#csharp-java-diffs "FAQ: What's the difference between C++ and C#/Java?" [universal-object]: /wiki/faq/csharp-java#universal-object "FAQ: Why doesn't C++ have a universal class Object?" [generics]: /wiki/faq/csharp-java#generics "FAQ: Is generics what templates should have been?" <!-- /wiki/faq/myths = 'Myths and Urban Legends About C++' --> [myths]: /wiki/faq/myths "Section: Myths and urban legends about C++" [temporaries]: /wiki/faq/myths#temporaries "FAQ: Why does C++ create useless deep copies of objects all over the place, such as returning by value?" [tools]: /wiki/faq/myths#tools "FAQ: Why doesn't C++ have modern compilers and tools to support things like refactoring? Why do I have to implement a whole C++ compiler to parse C++ instead of being able to plug into an existing implementation like I can for other languages?" [copy-elision]: /wiki/faq/myths#copy-elision "FAQ: What is copy elision? What is RVO?" <!-- /wiki/faq/value-vs-ref-semantics = 'Reference and Value Semantics' --> [value-vs-ref-semantics]: /wiki/faq/value-vs-ref-semantics "Section: Reference and Value Semantics" [val-vs-ref-semantics]: /wiki/faq/value-vs-ref-semantics#val-vs-ref-semantics "FAQ: What is value and/or reference semantics, and which is best in C++?" [virt-data]: /wiki/faq/value-vs-ref-semantics#virt-data "FAQ: What is 'virtual data,' and how-can / why-would I use it in C++?" [virt-vs-dynam-data]: /wiki/faq/value-vs-ref-semantics#virt-vs-dynam-data "FAQ: What's the difference between virtual data and dynamic data?" [compos-vs-heap]: /wiki/faq/value-vs-ref-semantics#compos-vs-heap "FAQ: Should I normally use pointers to freestore allocated objects for my data members, or should I use 'composition'?" [costs-of-heap]: /wiki/faq/value-vs-ref-semantics#costs-of-heap "FAQ: What are relative costs of the 3 performance hits associated with allocating member objects from the freestore?" [inline-virtuals]: /wiki/faq/value-vs-ref-semantics#inline-virtuals "FAQ: Are 'inline virtual' member functions ever actually 'inlined'?" [ref-semantics-sometimes-good]: /wiki/faq/value-vs-ref-semantics#ref-semantics-sometimes-good "FAQ: Sounds like I should never use reference semantics, right?" [pass-by-value]: /wiki/faq/value-vs-ref-semantics#pass-by-value "FAQ: Does the poor performance of reference semantics mean I should pass-by-value?" <!-- /wiki/faq/mixing-c-and-cpp = 'How to mix C and C++' --> [mixing-c-and-cpp]: /wiki/faq/mixing-c-and-cpp "Section: How to mix C and C++" [overview-mixing-langs]: /wiki/faq/mixing-c-and-cpp#overview-mixing-langs "FAQ: What do I need to know when mixing C and C++ code?" [call-c]: /wiki/faq/mixing-c-and-cpp#call-c "FAQ: How do I call a C function from C++?" [call-cpp]: /wiki/faq/mixing-c-and-cpp#call-cpp "FAQ: How do I call a C++ function from C?" [include-c-hdrs-system]: /wiki/faq/mixing-c-and-cpp#include-c-hdrs-system "FAQ: How can I include a standard C header file in my C++ code?" [include-c-hdrs-nonsystem]: /wiki/faq/mixing-c-and-cpp#include-c-hdrs-nonsystem "FAQ: How can I include a non-system C header file in my C++ code?" [include-c-hdrs-personal]: /wiki/faq/mixing-c-and-cpp#include-c-hdrs-personal "FAQ: How can I modify my own C header files so it's easier to #include them in C++ code?" [cpp-calls-c]: /wiki/faq/mixing-c-and-cpp#cpp-calls-c "FAQ: How can I call a non-system C function f(int,char,float) from my C++ code?" [c-calls-cpp]: /wiki/faq/mixing-c-and-cpp#c-calls-cpp "FAQ: How can I create a C++ function f(int,char,float) that is callable by my C code?" [link-errs-mixed-langs]: /wiki/faq/mixing-c-and-cpp#link-errs-mixed-langs "FAQ: Why is the linker giving errors for C/C++ functions being called from C++/C functions?" [cpp-objs-passed-to-c]: /wiki/faq/mixing-c-and-cpp#cpp-objs-passed-to-c "FAQ: How can I pass an object of a C++ class to/from a C function?" [get-cpp-data-members-from-c]: /wiki/faq/mixing-c-and-cpp#get-cpp-data-members-from-c "FAQ: Can my C function directly access data in an object of a C++ class?" [cpp-higher-than-c]: /wiki/faq/mixing-c-and-cpp#cpp-higher-than-c "FAQ: Why do I feel like I'm 'further from the machine' in C++ as opposed to C?" <!-- /wiki/faq/pointers-to-members = 'Pointers to Member Functions' --> [pointers-to-members]: /wiki/faq/pointers-to-members "Section: Pointers to Member Functions" [fnptr-vs-memfnptr-types]: /wiki/faq/pointers-to-members#fnptr-vs-memfnptr-types "FAQ: Is the type of 'pointer-to-member-function' different from 'pointer-to-function'?" [memfnptr-vs-fnptr]: /wiki/faq/pointers-to-members#memfnptr-vs-fnptr "FAQ: How do I pass a pointer-to-member-function to a signal handler, X event callback, system call that starts a thread/task, etc?" [memfnptr-vs-fnptr-more]: /wiki/faq/pointers-to-members#memfnptr-vs-fnptr-more "FAQ: Why do I keep getting compile errors (type mismatch) when I try to use a member function as an interrupt service routine?" [addr-of-memfn]: /wiki/faq/pointers-to-members#addr-of-memfn "FAQ: Why am I having trouble taking the address of a C++ function?" [typedef-for-ptr-to-memfn]: /wiki/faq/pointers-to-members#typedef-for-ptr-to-memfn "FAQ: How can I avoid syntax errors when creating pointers to members?" [macro-for-ptr-to-memfn]: /wiki/faq/pointers-to-members#macro-for-ptr-to-memfn "FAQ: How can I avoid syntax errors when calling a member function using a pointer-to-member-function?" [array-memfnptrs]: /wiki/faq/pointers-to-members#array-memfnptrs "FAQ: How do I create and use an array of pointer-to-member-function?" [memfnptr-to-const-memfn]: /wiki/faq/pointers-to-members#memfnptr-to-const-memfn "FAQ: How do I declare a pointer-to-member-function that points to a const member function?" [dotstar-vs-arrowstar]: /wiki/faq/pointers-to-members#dotstar-vs-arrowstar "FAQ: What is the difference between the .* and ->* operators?" [cant-cvt-memfnptr-to-voidptr]: /wiki/faq/pointers-to-members#cant-cvt-memfnptr-to-voidptr "FAQ: Can I convert a pointer-to-member-function to a void*?" [cant-cvt-fnptr-to-voidptr]: /wiki/faq/pointers-to-members#cant-cvt-fnptr-to-voidptr "FAQ: Can I convert a pointer-to-function to a void*?" [functionoids-teaser]: /wiki/faq/pointers-to-members#functionoids-teaser "FAQ: I need something like function-pointers, but with more flexibility and/or thread-safety; is there another way?" [functionoids]: /wiki/faq/pointers-to-members#functionoids "FAQ: What the heck is a functionoid, and why would I use one?" [functionoids2]: /wiki/faq/pointers-to-members#functionoids2 "FAQ: Can you make functionoids faster than normal function calls?" [functor-vs-functionoid]: /wiki/faq/pointers-to-members#functor-vs-functionoid "FAQ: What's the difference between a functionoid and a functor?" <!-- /wiki/faq/containers = 'Container Classes' --> [containers]: /wiki/faq/containers "Section: Container Classes" [arrays-are-evil]: /wiki/faq/containers#arrays-are-evil "FAQ: Why should I use container classes rather than simple arrays?" [associative-array]: /wiki/faq/containers#associative-array "FAQ: How can I make a perl-like associative array in C++?" [vector-is-contiguous]: /wiki/faq/containers#vector-is-contiguous "FAQ: Is the storage for a std::vector<T> guaranteed to be contiguous?" [heterogeneous-containers]: /wiki/faq/containers#heterogeneous-containers "FAQ: Why doesn't C++ provide heterogeneous containers?" [heterogeneous-list]: /wiki/faq/containers#heterogeneous-list "FAQ: How can I build a heterogeneous <favorite container> of objects of different types?" [container-ptr-conversion]: /wiki/faq/containers#container-ptr-conversion "FAQ: Why can't I assign a vector<Apple*> to a vector<Fruit*>?" [iterators]: /wiki/faq/containers#iterators "FAQ: How can I insert/access/change elements from a linked list/hashtable/etc?" [container-of-smart-ptr]: /wiki/faq/containers#container-of-smart-ptr "FAQ: Can I have a container of smart pointers to my objects?" [slow-containers]: /wiki/faq/containers#slow-containers "FAQ: Why are the standard containers so slow?" <!-- /wiki/faq/templates = 'Templates' --> [templates]: /wiki/faq/templates "Section: Templates" [overview-templates]: /wiki/faq/templates#overview-templates "FAQ: What's the idea behind templates?" [class-templates]: /wiki/faq/templates#class-templates "FAQ: What's the syntax / semantics for a 'class template'?" [fn-templates]: /wiki/faq/templates#fn-templates "FAQ: What's the syntax / semantics for a 'function template'?" [fn-templates-explicit-calls]: /wiki/faq/templates#fn-templates-explicit-calls "FAQ: How do I explicitly select which version of a function template should get called?" [param-types]: /wiki/faq/templates#param-types "FAQ: What is a 'parameterized type'?" [genericity]: /wiki/faq/templates#genericity "FAQ: What is 'genericity'?" [template-specialization]: /wiki/faq/templates#template-specialization "FAQ: 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?" [template-specialization-example]: /wiki/faq/templates#template-specialization-example "FAQ: Huh? Can you provide an example of template specialization that doesn't use foo and bar?" [template-specialization-piecemeal]: /wiki/faq/templates#template-specialization-piecemeal "FAQ: 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?" [template-specialization-speed]: /wiki/faq/templates#template-specialization-speed "FAQ: All those templates and template specializations must slow down my program, right?" [templates-vs-overloading]: /wiki/faq/templates#templates-vs-overloading "FAQ: So templates are overloading, right?" [templates-defn-vs-decl]: /wiki/faq/templates#templates-defn-vs-decl "FAQ: Why can't I separate the definition of my templates class from its declaration and put it inside a .cpp file?" [separate-template-fn-defn-from-decl]: /wiki/faq/templates#separate-template-fn-defn-from-decl "FAQ: How can I avoid linker errors with my template functions?" [separate-template-fn-defn-from-decl-export-keyword]: /wiki/faq/templates#separate-template-fn-defn-from-decl-export-keyword "FAQ: How does the C++ keyword export help with template linker errors?" [separate-template-class-defn-from-decl]: /wiki/faq/templates#separate-template-class-defn-from-decl "FAQ: How can I avoid linker errors with my template classes?" [template-friends]: /wiki/faq/templates#template-friends "FAQ: Why do I get linker errors when I use template friends?" [constraints]: /wiki/faq/templates#constraints "FAQ: Why can't I define constraints for my template parameters?" [template-error-msgs]: /wiki/faq/templates#template-error-msgs "FAQ: How can any human hope to understand these overly verbose template-based error messages?" [nondependent-name-lookup-types]: /wiki/faq/templates#nondependent-name-lookup-types "FAQ: Why am I getting errors when my template-derived-class uses a nested type it inherits from its template-base-class?" [nondependent-name-lookup-members]: /wiki/faq/templates#nondependent-name-lookup-members "FAQ: Why am I getting errors when my template-derived-class uses a member it inherits from its template-base-class?" [nondependent-name-lookup-silent-bug]: /wiki/faq/templates#nondependent-name-lookup-silent-bug "FAQ: Can the previous problem hurt me silently? Is it possible that the compiler will silently generate the wrong code?" [template-of-template]: /wiki/faq/templates#template-of-template "FAQ: How can I create a container-template that allows my users to supply the type of the underlying container that actually stores the values?" [template-proxies]: /wiki/faq/templates#template-proxies "FAQ: Follow-up to previous: can I pass in the underlying structure and the element-type separately?" [template-proxies-and-runtime-performance]: /wiki/faq/templates#template-proxies-and-runtime-performance "FAQ: Related: all those proxies must negatively reflect on the speed of my program. Don't they?" <!-- /wiki/faq/serialization = 'Serialization and Unserialization' --> [serialization]: /wiki/faq/serialization "Section: Serialization and Unserialization" [serialize-overview]: /wiki/faq/serialization#serialize-overview "FAQ: What's this 'serialization' thing all about?" [serialize-selection]: /wiki/faq/serialization#serialize-selection "FAQ: How do I select the best serialization technique?" [serialize-decide-text-vs-binary]: /wiki/faq/serialization#serialize-decide-text-vs-binary "FAQ: How do I decide whether to serialize to human-readable ('text') or non-human-readable ('binary') format?" [serialize-simple-types]: /wiki/faq/serialization#serialize-simple-types "FAQ: How do I serialize/unserialize simple types like numbers, characters, strings, etc.?" [serialize-text-format]: /wiki/faq/serialization#serialize-text-format "FAQ: How exactly do I read/write simple types in human-readable ('text') format?" [serialize-binary-format]: /wiki/faq/serialization#serialize-binary-format "FAQ: How exactly do I read/write simple types in non-human-readable ('binary') format?" [serialize-no-inherit-no-ptrs]: /wiki/faq/serialization#serialize-no-inherit-no-ptrs "FAQ: How do I serialize objects that aren't part of an inheritance hierarchy and that don't contain pointers to other objects?" [serialize-inherit-no-ptrs]: /wiki/faq/serialization#serialize-inherit-no-ptrs "FAQ: How do I serialize objects that are part of an inheritance hierarchy and that don't contain pointers to other objects?" [serialize-no-cycles-no-joins]: /wiki/faq/serialization#serialize-no-cycles-no-joins "FAQ: How do I serialize objects that contain pointers to other objects, but those pointers form a tree with no cycles and no joins?" [serialize-no-cycles-trivial-joins]: /wiki/faq/serialization#serialize-no-cycles-trivial-joins "FAQ: How do I serialize objects that contain pointers to other objects, but those pointers form a tree with no cycles and only 'trivial' joins?" [serialize-with-cycles]: /wiki/faq/serialization#serialize-with-cycles "FAQ: 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?" [serialize-conclusions]: /wiki/faq/serialization#serialize-conclusions "FAQ: Are there any caveats when serializing / unserializing objects?" [serialize-graph-lingo]: /wiki/faq/serialization#serialize-graph-lingo "FAQ: What's all this about graphs, trees, nodes, cycles, joins, and joins at the leaves vs. internal nodes?" <!-- /wiki/faq/class-libraries = 'Class Libraries' --> [class-libraries]: /wiki/faq/class-libraries "Section: Class Libraries" [stl]: /wiki/faq/class-libraries#stl "FAQ: What is the 'STL'?" [downloading-stl]: /wiki/faq/class-libraries#downloading-stl "FAQ: Where can I get a copy of 'STL'?" [find-obj-in-stl-ptr-container]: /wiki/faq/class-libraries#find-obj-in-stl-ptr-container "FAQ: How can I find a Fred object in an STL container of Fred* such as std::vector<Fred*>?" [stl-help]: /wiki/faq/class-libraries#stl-help "FAQ: Where can I get help on how to use STL?" [dynam-typed-libs]: /wiki/faq/class-libraries#dynam-typed-libs "FAQ: How can you tell if you have a dynamically typed C++ class library?" [nihcl]: /wiki/faq/class-libraries#nihcl "FAQ: What is the NIHCL? Where can I get it?" [numerical-recipes]: /wiki/faq/class-libraries#numerical-recipes "FAQ: Where can I ftp the code that accompanies 'Numerical Recipes'?" [big-exes]: /wiki/faq/class-libraries#big-exes "FAQ: Why is my executable so large?" [libraries-faq]: /wiki/faq/class-libraries#libraries-faq "FAQ: Where can I get tons and tons of more information on C++ class libraries?" <!-- /wiki/faq/compiler-dependencies = 'Compiler Dependencies' --> [compiler-dependencies]: /wiki/faq/compiler-dependencies "Section: Compiler Dependencies" [free-cpp-compiler]: /wiki/faq/compiler-dependencies#free-cpp-compiler "FAQ: Where can I download a free C++ compiler?" [mfc-faq]: /wiki/faq/compiler-dependencies#mfc-faq "FAQ: Where can I get more information on using MFC and Visual C++?" [mfc-status-bar]: /wiki/faq/compiler-dependencies#mfc-status-bar "FAQ: How do I display text in the status bar using MFC?" [decompiling]: /wiki/faq/compiler-dependencies#decompiling "FAQ: How can I decompile an executable program back into C++ source code?" [compiler-specific-info]: /wiki/faq/compiler-dependencies#compiler-specific-info "FAQ: Where can I get information about the C++ compiler from {Borland, IBM, Microsoft, Sun, etc.}?" [cpp-vs-visual-cpp]: /wiki/faq/compiler-dependencies#cpp-vs-visual-cpp "FAQ: What's the difference between C++ and Visual C++?" [num-elems-in-new-array-overalloc]: /wiki/faq/compiler-dependencies#num-elems-in-new-array-overalloc "FAQ: How do compilers use 'over-allocation' to remember the number of elements in an allocated array?" [num-elems-in-new-array-assocarray]: /wiki/faq/compiler-dependencies#num-elems-in-new-array-assocarray "FAQ: How do compilers use an 'associative array' to remember the number of elements in an allocated array?" [binary-compat]: /wiki/faq/compiler-dependencies#binary-compat "FAQ: If name mangling was standardized, could I link code compiled with compilers from different compiler vendors?" [big-exes-gpp]: /wiki/faq/compiler-dependencies#big-exes-gpp "FAQ: GNU C++ (g++) produces big executables for tiny programs; Why?" [yaccable-grammar]: /wiki/faq/compiler-dependencies#yaccable-grammar "FAQ: Is there a yacc-able C++ grammar?" [version-nums]: /wiki/faq/compiler-dependencies#version-nums "FAQ: What is C++ 1.2? 2.0? 2.1? 3.0?" [convert-to-c]: /wiki/faq/compiler-dependencies#convert-to-c "FAQ: Is it possible to convert C++ to C?" <!-- /wiki/faq/misc-technical-issues = 'Miscellaneous Technical Issues' --> [misc-technical-issues]: /wiki/faq/misc-technical-issues "Section: Miscellaneous Technical Issues" [function-object]: /wiki/faq/misc-technical-issues#function-object "FAQ: What is a function object?" [convert-num-to-string]: /wiki/faq/misc-technical-issues#convert-num-to-string "FAQ: How do I convert a value (a number, for example) to a std::string?" [convert-string-to-num]: /wiki/faq/misc-technical-issues#convert-string-to-num "FAQ: How do I convert a std::string to a number?" [convert-string-to-any]: /wiki/faq/misc-technical-issues#convert-string-to-any "FAQ: Can I templatize the above functions so they work with other types?" [abstract-class]: /wiki/faq/misc-technical-issues#abstract-class "FAQ: Why do my compiles take so long?" [macros-with-if]: /wiki/faq/misc-technical-issues#macros-with-if "FAQ: What should be done with macros that contain if?" [macros-with-multi-stmts]: /wiki/faq/misc-technical-issues#macros-with-multi-stmts "FAQ: What should be done with macros that have multiple lines?" [macros-with-token-pasting]: /wiki/faq/misc-technical-issues#macros-with-token-pasting "FAQ: What should be done with macros that need to paste two tokens together?" [backslashes-in-include-files]: /wiki/faq/misc-technical-issues#backslashes-in-include-files "FAQ: Why can't the compiler find my header file in #include 'c:\test.h' ?" [scope-of-for-loop-var]: /wiki/faq/misc-technical-issues#scope-of-for-loop-var "FAQ: What are the C++ scoping rules for for loops?" [overload-by-return-type]: /wiki/faq/misc-technical-issues#overload-by-return-type "FAQ: Why can't I overload a function by its return type?" [persistence]: /wiki/faq/misc-technical-issues#persistence "FAQ: What is 'persistence'? What is a 'persistent object'?" [forward-decl]: /wiki/faq/misc-technical-issues#forward-decl "FAQ: How can I create two classes that both know about each other?" [forward-decl-members]: /wiki/faq/misc-technical-issues#forward-decl-members "FAQ: What special considerations are needed when forward declarations are used with member objects?" [forward-decl-inline]: /wiki/faq/misc-technical-issues#forward-decl-inline "FAQ: What special considerations are needed when forward declarations are used with inline functions?" [forward-decl-templates]: /wiki/faq/misc-technical-issues#forward-decl-templates "FAQ: Why can't I put a forward-declared class in a std::vector<>?" [double-mod-betw-seq-pt]: /wiki/faq/misc-technical-issues#double-mod-betw-seq-pt "FAQ: Why do some people think x = ++y + y++ is bad?" [evaluation-order]: /wiki/faq/misc-technical-issues#evaluation-order "FAQ: What's the value of i++ + i++?" [sequence-points]: /wiki/faq/misc-technical-issues#sequence-points "FAQ: What's the deal with 'sequence points'?" <!-- /wiki/faq/misc-environmental-issues = 'Miscellaneous Environmental Issues' --> [misc-environmental-issues]: /wiki/faq/misc-environmental-issues "Section: Miscellaneous Environmental Issues" [javadoc-comments]: /wiki/faq/misc-environmental-issues#javadoc-comments "FAQ: How can I generate HTML documentation for my classes? Does C++ have anything similar to javadoc?" [latex-macros]: /wiki/faq/misc-environmental-issues#latex-macros "FAQ: Is there a TeX or LaTeX macro that fixes the spacing on 'C++'?" [pretty-printers]: /wiki/faq/misc-environmental-issues#pretty-printers "FAQ: Are there any pretty-printers that reformat C++ source code?" [gnu-emacs-cpp-mode]: /wiki/faq/misc-environmental-issues#gnu-emacs-cpp-mode "FAQ: Is there a C++-mode for GNU emacs? If so, where can I get it?" [os-specific-faqs]: /wiki/faq/misc-environmental-issues#os-specific-faqs "FAQ: Where can I get OS-specific questions answered (e.g., BC++, Windows, etc)?" [floating-pt-link-err]: /wiki/faq/misc-environmental-issues#floating-pt-link-err "FAQ: Why does my DOS C++ program says 'Sorry: floating point code not linked'?" [bcpp-crash]: /wiki/faq/misc-environmental-issues#bcpp-crash "FAQ: Why does my BC++ Windows app crash when I'm not running the BC45 IDE?" <!-- /wiki/faq/style-and-techniques = 'Miscellaneous Style Issues' --> [style-and-techniques]: /wiki/faq/style-and-techniques "Section: Miscellaneous Style Issues" [whitespace]: /wiki/faq/style-and-techniques#whitespace "FAQ: Is int* p; right or is int *p; right?" [layout-style]: /wiki/faq/style-and-techniques#layout-style "FAQ: Which layout style is the best for my code?" [hungarian]: /wiki/faq/style-and-techniques#hungarian "FAQ: How do you name variables? Do you recommend Hungarian notation?" [const-placement]: /wiki/faq/style-and-techniques#const-placement "FAQ: Should I put const before or after the type?" [static-cast]: /wiki/faq/style-and-techniques#static-cast "FAQ: What good is static_cast?" [why-not-macros]: /wiki/faq/style-and-techniques#why-not-macros "FAQ: So, what's wrong with using macros?" [pronounce-cout]: /wiki/faq/style-and-techniques#pronounce-cout "FAQ: How do you pronounce cout?" [pronounce-char]: /wiki/faq/style-and-techniques#pronounce-char "FAQ: How do you pronounce char?" <!-- /wiki/faq/user-groups-worldwide = 'User Groups Worldwide' --> [user-groups-worldwide]: /wiki/faq/user-groups-worldwide "Section: User Groups Worldwide" [user-groups-belgium]: /wiki/faq/user-groups-worldwide#user-groups-belgium "FAQ: User groups in Belgium" [user-groups-brazil]: /wiki/faq/user-groups-worldwide#user-groups-brazil "FAQ: User groups in Brazil" [user-groups-canada]: /wiki/faq/user-groups-worldwide#user-groups-canada "FAQ: User groups in Canada" [user-groups-france]: /wiki/faq/user-groups-worldwide#user-groups-france "FAQ: User groups in France" [user-groups-germany]: /wiki/faq/user-groups-worldwide#user-groups-germany "FAQ: User groups in Germany" [user-groups-italy]: /wiki/faq/user-groups-worldwide#user-groups-italy "FAQ: User groups in Italy" [user-groups-norway]: /wiki/faq/user-groups-worldwide#user-groups-norway "FAQ: User groups in Norway" [user-groups-poland]: /wiki/faq/user-groups-worldwide#user-groups-poland "FAQ: User groups in Poland" [user-groups-Russia]: /wiki/faq/user-groups-worldwide#user-groups-Russia "FAQ: User groups in Russia" [user-groups-sweden]: /wiki/faq/user-groups-worldwide#user-groups-sweden "FAQ: User groups in Sweden" [user-groups-uk]: /wiki/faq/user-groups-worldwide#user-groups-uk "FAQ: User groups in United Kingdom" [user-groups-us]: /wiki/faq/user-groups-worldwide#user-groups-us "FAQ: User groups in United States" <!-- /wiki/faq/cpp11 = 'C++11 Overview' --> [cpp11]: /wiki/faq/cpp11 "Section: C++11 Overview" [cpp11-purpose]: /wiki/faq/cpp11#purpose "FAQ: C++11: Purpose of this FAQ section" [cpp11-what]: /wiki/faq/cpp11#cpp11-what "FAQ: What is C++11?" [cpp0x-what]: /wiki/faq/cpp11#cpp0x-what "FAQ: What is C++0x?" [cpp11-when-compilers]: /wiki/faq/cpp11#cpp11-when-compilers "FAQ: When will compilers implement C++11?" [cpp11-approach]: /wiki/faq/cpp11#cpp11-approach "FAQ: How did the committee approach picking new language and library features for C++11?" [cpp11-goals]: /wiki/faq/cpp11#cpp11-goals "FAQ: What were the general design goals of the C++11 effort?" [cpp11-specific-goals]: /wiki/faq/cpp11#cpp11-specific-goals "FAQ: What specific design goals guided the committee?" [cpp11-wg21]: /wiki/faq/cpp11#cpp11-wg21 "FAQ: Where can I find the committee papers for C++11 features?" [cpp11-technical-papers]: /wiki/faq/cpp11#cpp11-technical-papers "FAQ: Where can I find academic and technical papers about C++11?" [cpp11-other-reading]: /wiki/faq/cpp11#cpp11-other-reading "FAQ: Where else can I read about C++11?" [cpp11-videos]: /wiki/faq/cpp11#cpp11-videos "FAQ: Are there any videos about C++11?" [cpp11-learn]: /wiki/faq/cpp11#cpp11-learn "FAQ: Is C++11 hard to learn?" [cpp11-final]: /wiki/faq/cpp11#cpp11-final "FAQ: Is C++11 the final C++ standard?" <!-- /wiki/faq/cpp11-language = 'C++11 Language Extensions --- General Features' --> [cpp11-language]: /wiki/faq/cpp11-language "Section: C++11 Language Extensions --- General Features" [auto]: /wiki/faq/cpp11-language#auto "FAQ: auto" [decltype]: /wiki/faq/cpp11-language#decltype "FAQ: decltype" [range-for]: /wiki/faq/cpp11-language#range-for "FAQ: Range-for statement" [init-list]: /wiki/faq/cpp11-language#init-list "FAQ: Initializer lists" [uniform-init]: /wiki/faq/cpp11-language#uniform-init "FAQ: Uniform initialization syntax and semantics" [rval]: /wiki/faq/cpp11-language#rval "FAQ: Rvalue references and move semantics" [lambda]: /wiki/faq/cpp11-language#lambda "FAQ: Lambdas" [noexcept]: /wiki/faq/cpp11-language#noexcept "FAQ: noexcept to prevent exception propagation" [constexpr]: /wiki/faq/cpp11-language#constexpr "FAQ: constexpr" [nullptr]: /wiki/faq/cpp11-language#nullptr "FAQ: nullptr -- a null pointer literal" [exception-ptr]: /wiki/faq/cpp11-language#exception-ptr "FAQ: Copying and rethrowing exceptions" [inline-namespace]: /wiki/faq/cpp11-language#inline-namespace "FAQ: Inline namespaces" [udls]: /wiki/faq/cpp11-language#udls "FAQ: User-defined literals" <!-- /wiki/faq/cpp11-language-classes = 'C++11 Language Extensions -- Classes' --> [cpp11-language-classes]: /wiki/faq/cpp11-language-classes "Section: C++11 Language Extensions -- Classes" [default-delete]: /wiki/faq/cpp11-language-classes#default-delete "FAQ: =default and =delete" [default-move-copy]: /wiki/faq/cpp11-language-classes#default-move-copy "FAQ: Control of default move and copy" [delegating-ctor]: /wiki/faq/cpp11-language-classes#delegating-ctor "FAQ: Delegating constructors" [member-init]: /wiki/faq/cpp11-language-classes#member-init "FAQ: In-class member initializers" [inherited-ctors]: /wiki/faq/cpp11-language-classes#inherited-ctors "FAQ: Inherited constructors" [override]: /wiki/faq/cpp11-language-classes#override "FAQ: Override controls: override" [final]: /wiki/faq/cpp11-language-classes#final "FAQ: Override controls: final" [explicit-conversion-operators]: /wiki/faq/cpp11-language-classes#explicit-conversion-operators "FAQ: Explicit conversion operators" <!-- /wiki/faq/cpp11-language-concurrency = 'C++11 Language Extensions --- Concurrency' --> [cpp11-language-concurrency]: /wiki/faq/cpp11-language-concurrency "Section: C++11 Language Extensions --- Concurrency" [memory-model]: /wiki/faq/cpp11-language-concurrency#memory-model "FAQ: Concurrency memory model" [dynamic-init]: /wiki/faq/cpp11-language-concurrency#dynamic-init "FAQ: Dynamic initialization and destruction with concurrency" [thread-local]: /wiki/faq/cpp11-language-concurrency#thread-local "FAQ: Thread-local storage" <!-- /wiki/faq/cpp11-language-misc = 'C++11 Language Extensions --- Miscellaneous Language Features' --> [cpp11-language-misc]: /wiki/faq/cpp11-language-misc "Section: C++11 Language Extensions --- Miscellaneous Language Features" [cpp11-cplusplus]: /wiki/faq/cpp11-language-misc#cpp11-cplusplus "FAQ: What is the value of `__cplusplus` for C++11?" [suffix-return]: /wiki/faq/cpp11-language-misc#suffix-return "FAQ: Suffix return type syntax" [cpp11-narrowing]: /wiki/faq/cpp11-language-misc#cpp11-narrowing "FAQ: Preventing narrowing" [right-angles]: /wiki/faq/cpp11-language-misc#right-angles "FAQ: Right-angle brackets" [static-assert]: /wiki/faq/cpp11-language-misc#static-assert "FAQ: static_assert compile-time assertions" [raw-strings]: /wiki/faq/cpp11-language-misc#raw-strings "FAQ: Raw string literals" [attributes]: /wiki/faq/cpp11-language-misc#attributes "FAQ: Attributes" [align]: /wiki/faq/cpp11-language-misc#align "FAQ: Alignment" [cpp11-c99]: /wiki/faq/cpp11-language-misc#cpp11-c99 "FAQ: C99 features" <!-- /wiki/faq/cpp11-language-templates = 'C++11 Language Extensions -- Templates' --> [cpp11-language-templates]: /wiki/faq/cpp11-language-templates "Section: C++11 Language Extensions -- Templates" [extern-templates]: /wiki/faq/cpp11-language-templates#extern-templates "FAQ: Extern templates" [template-alias]: /wiki/faq/cpp11-language-templates#template-alias "FAQ: Template aliases" [variadic-templates]: /wiki/faq/cpp11-language-templates#variadic-templates "FAQ: Variadic templates" [local-types]: /wiki/faq/cpp11-language-templates#local-types "FAQ: Local types as template arguments" <!-- /wiki/faq/cpp11-language-types = 'C++11 Language Extensions --- Other Types' --> [cpp11-language-types]: /wiki/faq/cpp11-language-types "Section: C++11 Language Extensions --- Other Types" [enum-class]: /wiki/faq/cpp11-language-types#enum-class "FAQ: enum class" [long-long]: /wiki/faq/cpp11-language-types#long-long "FAQ: long long -- a longer integer" [extended-int]: /wiki/faq/cpp11-language-types#extended-int "FAQ: Extended integer types" [generalized-unions]: /wiki/faq/cpp11-language-types#generalized-unions "FAQ: Generalized unions" [generalized-pods]: /wiki/faq/cpp11-language-types#generalized-pods "FAQ: Generalized PODs" <!-- /wiki/faq/cpp11-library = 'C++11 Library Extensions --- General Libraries' --> [cpp11-library]: /wiki/faq/cpp11-library "Section: C++11 Library Extensions --- General Libraries" [unique-ptr]: /wiki/faq/cpp11-library#unique-ptr "FAQ: unique_ptr" [shared-ptr]: /wiki/faq/cpp11-library#shared-ptr "FAQ: shared_ptr" [weak-ptr]: /wiki/faq/cpp11-library#weak-ptr "FAQ: weak_ptr" [gc-abi]: /wiki/faq/cpp11-library#gc-abi "FAQ: Garbage collection ABI" [tuple]: /wiki/faq/cpp11-library#tuple "FAQ: tuple" [type-traits]: /wiki/faq/cpp11-library#type-traits "FAQ: Type traits" [std-function]: /wiki/faq/cpp11-library#std-function "FAQ: function and bind" [std-regex]: /wiki/faq/cpp11-library#std-regex "FAQ: Regular expressions" [std-duration]: /wiki/faq/cpp11-library#std-duration "FAQ: Time utilities" [std-random]: /wiki/faq/cpp11-library#std-random "FAQ: Random number generation" [scoped-allocator]: /wiki/faq/cpp11-library#scoped-allocator "FAQ: Scoped allocators" <!-- /wiki/faq/cpp11-library-concurrency = 'C++11 Standard Library Extensions --- Concurrency' --> [cpp11-library-concurrency]: /wiki/faq/cpp11-library-concurrency "Section: C++11 Standard Library Extensions --- Concurrency" [std-threads]: /wiki/faq/cpp11-library-concurrency#std-threads "FAQ: Threads" [std-mutex]: /wiki/faq/cpp11-library-concurrency#std-mutex "FAQ: Mutual exclusion" [std-lock]: /wiki/faq/cpp11-library-concurrency#std-lock "FAQ: Locks" [std-condition]: /wiki/faq/cpp11-library-concurrency#std-condition "FAQ: Condition variables" [std-atomics]: /wiki/faq/cpp11-library-concurrency#std-atomics "FAQ: Atomics" [cpp11-future]: /wiki/faq/cpp11-library-concurrency#cpp11-future "FAQ: Futures and promises" [std-async]: /wiki/faq/cpp11-library-concurrency#std-async "FAQ: async" [abandoning]: /wiki/faq/cpp11-library-concurrency#abandoning "FAQ: Abandoning a process" <!-- /wiki/faq/cpp11-library-stl = 'C++11 Standard Library Extensions --- Containers and Algorithms' --> [cpp11-library-stl]: /wiki/faq/cpp11-library-stl "Section: C++11 Standard Library Extensions --- Containers and Algorithms" [cpp11-algorithms]: /wiki/faq/cpp11-library-stl#cpp11-algorithms "FAQ: Algorithms improvements" [cpp11-containers]: /wiki/faq/cpp11-library-stl#cpp11-containers "FAQ: Container improvements" [std-unordered]: /wiki/faq/cpp11-library-stl#std-unordered "FAQ: unordered_* containers" [std-array]: /wiki/faq/cpp11-library-stl#std-array "FAQ: std::array" [forward-list]: /wiki/faq/cpp11-library-stl#forward-list "FAQ: forward_list" <!-- /wiki/faq/cpp0x-concepts-history = 'C++0x Concepts --- Historical FAQs' --> [cpp0x-concepts-history]: /wiki/faq/cpp0x-concepts-history "Section: C++0x Concepts --- Historical FAQs" [cpp0x-concepts-overview]: /wiki/faq/cpp0x-concepts-history#cpp0x-concepts-overview "FAQ: What happened to C++0x concepts?" [cpp0x-concepts]: /wiki/faq/cpp0x-concepts-history#cpp0x-concepts "FAQ: What were C++0x concepts?" [cpp0x-concept-maps]: /wiki/faq/cpp0x-concepts-history#cpp0x-concept-maps "FAQ: What were C++0x concept maps?" [cpp0x-axioms]: /wiki/faq/cpp0x-concepts-history#cpp0x-axioms "FAQ: What were C++0x axioms?" <!-- /wiki/faq/cpp14 = 'C++14 Overview' --> [cpp14]: /wiki/faq/cpp14 "Section: C++14 Overview" [cpp14-purpose]: /wiki/faq/cpp14#cpp14-purpose "FAQ: C++14: Purpose of this FAQ section" [cpp14-what]: /wiki/faq/cpp14#cpp14-what "FAQ: What is C++14?" [cpp14-compilers]: /wiki/faq/cpp14#cpp14-compilers "FAQ: When will compilers implement C++14?" [cpp14-wg21]: /wiki/faq/cpp14#cpp14-wg21 "FAQ: Where can I find the committee papers for C++14 features?" [cpp14-other-reading]: /wiki/faq/cpp14#cpp14-other-reading "FAQ: Where else can I read about C++14?" [cpp14-videos]: /wiki/faq/cpp14#cpp14-videos "FAQ: Are there any videos about C++14?" [cpp14-final]: /wiki/faq/cpp14#cpp14-final "FAQ: Is C++14 the final C++ standard?" <!-- /wiki/faq/cpp14-language = 'C++14 Language Extensions' --> [cpp14-language]: /wiki/faq/cpp14-language "Section: C++14 Language Extensions" [binary-literals]: /wiki/faq/cpp14-language#binary-literals "FAQ: Binary literals" [generalized-return]: /wiki/faq/cpp14-language#generalized-return "FAQ: Generalized return type deduction" [decltype-auto]: /wiki/faq/cpp14-language#decltype-auto "FAQ: decltype(auto)" [lambda-captures]: /wiki/faq/cpp14-language#lambda-captures "FAQ: Generalized lambda captures" [generic-lambdas]: /wiki/faq/cpp14-language#generic-lambdas "FAQ: Generic lambdas" [variable-templates]: /wiki/faq/cpp14-language#variable-templates "FAQ: Variable templates" [extended-constexpr]: /wiki/faq/cpp14-language#extended-constexpr "FAQ: Extended constexpr" [deprecated-attribute]: /wiki/faq/cpp14-language#deprecated-attribute "FAQ: The [ [deprecated] ] attribute" [digit-separators]: /wiki/faq/cpp14-language#digit-separators "FAQ: Digit separators" <!-- /wiki/faq/cpp14-library = 'C++14 Library Extensions' --> [cpp14-library]: /wiki/faq/cpp14-library "Section: C++14 Library Extensions" [shared-locking]: /wiki/faq/cpp14-library#shared-locking "FAQ: Shared locking" [std-udls]: /wiki/faq/cpp14-library#std-udls "FAQ: User-defined literals for std:: types" [make-unique]: /wiki/faq/cpp14-library#make-unique "FAQ: make_unique" [type-transformation-aliases]: /wiki/faq/cpp14-library#type-transformation-aliases "FAQ: Type transformation _t aliases" <!-- /wiki/faq/wg21 = 'WG21 Members' --> [wg21]: /wiki/faq/wg21 "Section: WG21 Members" [matt-austern]: /wiki/faq/wg21#matt-austern "Matt Austern" [dean-michael-berris]: /wiki/faq/wg21#dean-michael-berris "Dean Michael Berris" [hans-boehm]: /wiki/faq/wg21#hans-boehm "Hans Boehm" [chandler-carruth]: /wiki/faq/wg21#chandler-carruth "Chandler Carruth" [steve-clamage]: /wiki/faq/wg21#steve-clamage "Stephen D. Clamage" [stefanus-du-toit]: /wiki/faq/wg21#stefanus-du-toit "Stefanus Du Toit" [j-daniel-garcia]: /wiki/faq/wg21#j-daniel-garcia "J. Daniel Garcia" [peter-gottschling]: /wiki/faq/wg21#peter-gottschling "Peter Gottschling" [howard-hinnant]: /wiki/faq/wg21#howard-hinnant "Howard Hinnant" [kyle-kloepper]: /wiki/faq/wg21#kyle-kloepper "Kyle Kloepper" [dietmar-kuehl]: /wiki/faq/wg21#dietmar-kuehl "Dietmar Kühl" [mike-miller]: /wiki/faq/wg21#mike-miller "William M. (Mike) Miller" [clark-nelson]: /wiki/faq/wg21#clark-nelson "Clark Nelson" [eric-niebler]: /wiki/faq/wg21#eric-niebler "Eric Niebler" [roger-orr]: /wiki/faq/wg21#roger-orr "Roger Orr" [p-j-plauger]: /wiki/faq/wg21#p-j-plauger "P.J. Plauger" [bill-seymour]: /wiki/faq/wg21#bill-seymour "Bill Seymour" [peter-sommerlad]: /wiki/faq/wg21#peter-sommerlad "Peter Sommerlad" [bjarne-stroustrup]: /wiki/faq/wg21#bjarne-stroustrup "Bjarne Stroustrup" [herb-sutter]: /wiki/faq/wg21#herb-sutter "Herb Sutter" [andrew-sutton]: /wiki/faq/wg21#andrew-sutton "Andrew Sutton" [daveed-vandevoorde]: /wiki/faq/wg21#daveed-vandevoorde "Daveed Vandevoorde" [j-c-van-winkel]: /wiki/faq/wg21#j-c-van-winkel "J.C. van Winkel" [ville-voutilainen]: /wiki/faq/wg21#ville-voutilainen "Ville Voutilainen" [michael-wong]: /wiki/faq/wg21#michael-wong "Michael Wong" [jeffrey-yasskin]: /wiki/faq/wg21#jeffrey-yasskin "Jeffrey Yasskin" <!-- /wiki/faq/subject-index = 'Subject Index' --> [subject-index]: /wiki/faq/subject-index "Subject Index" [subject-index-a]: /wiki/faq/subject-index#subject-index-a "Items beginning with 'A'" [subject-index-b]: /wiki/faq/subject-index#subject-index-b "Items beginning with 'B'" [subject-index-c]: /wiki/faq/subject-index#subject-index-c "Items beginning with 'C'" [subject-index-d]: /wiki/faq/subject-index#subject-index-d "Items beginning with 'D'" [subject-index-e]: /wiki/faq/subject-index#subject-index-e "Items beginning with 'E'" [subject-index-f]: /wiki/faq/subject-index#subject-index-f "Items beginning with 'F'" [subject-index-g]: /wiki/faq/subject-index#subject-index-g "Items beginning with 'G'" [subject-index-h]: /wiki/faq/subject-index#subject-index-h "Items beginning with 'H'" [subject-index-i]: /wiki/faq/subject-index#subject-index-i "Items beginning with 'I'" [subject-index-j]: /wiki/faq/subject-index#subject-index-j "Items beginning with 'J'" [subject-index-k]: /wiki/faq/subject-index#subject-index-k "Items beginning with 'K'" [subject-index-l]: /wiki/faq/subject-index#subject-index-l "Items beginning with 'L'" [subject-index-m]: /wiki/faq/subject-index#subject-index-m "Items beginning with 'M'" [subject-index-n]: /wiki/faq/subject-index#subject-index-n "Items beginning with 'N'" [subject-index-o]: /wiki/faq/subject-index#subject-index-o "Items beginning with 'O'" [subject-index-p]: /wiki/faq/subject-index#subject-index-p "Items beginning with 'P'" [subject-index-q]: /wiki/faq/subject-index#subject-index-q "Items beginning with 'Q'" [subject-index-r]: /wiki/faq/subject-index#subject-index-r "Items beginning with 'R'" [subject-index-s]: /wiki/faq/subject-index#subject-index-s "Items beginning with 'S'" [subject-index-t]: /wiki/faq/subject-index#subject-index-t "Items beginning with 'T'" [subject-index-u]: /wiki/faq/subject-index#subject-index-u "Items beginning with 'U'" [subject-index-v]: /wiki/faq/subject-index#subject-index-v "Items beginning with 'V'" [subject-index-w]: /wiki/faq/subject-index#subject-index-w "Items beginning with 'W'" [subject-index-x]: /wiki/faq/subject-index#subject-index-x "Items beginning with 'X'" [subject-index-y]: /wiki/faq/subject-index#subject-index-y "Items beginning with 'Y'" [subject-index-z]: /wiki/faq/subject-index#subject-index-z "Items beginning with 'Z'"