C++ programs: 108

bad_cin_input.cpp: Detect, clear, and ignore bad input from cin [May-21-2009]

member_def_args.cpp: default value for member functions [Feb-26-2009]

union_bytes.cpp: union of char array and long to access a number as a string [Jan-31-2008]

meyers_singleton.cpp: Scott Meyers' Singleton pattern [Dec-25-2007]

adj_string_literals.cpp: adjacent string literals are concatenated as part of compilation [Nov-11-2007]

agg_init.cpp: initialize syntax for structs and arrays [Nov-11-2007]

allocation_func2.cpp: overriding the global allocation and deallocation functions [Nov-11-2007]

alloc_member.cpp: class member allocation and deallocation functions [Nov-11-2007]

alternative_tokens.cpp: you can use 'and' instead of '&&', and other alternative tokens [Nov-11-2007]

any.cpp: boost any, generic type for holding data [Nov-11-2007]

array_of_objects_init.cpp: Initialization of an array of objects [Nov-11-2007]

array_ref.cpp: references to arrays and references to pointers to arrays [Nov-11-2007]

array_typedef.cpp: typedefs of arrays [Nov-11-2007]

assign_vs_init.cpp: Distinguishing between initialization and assignment [Nov-11-2007]

autoptr.cpp: std::auto_ptr assignment, copy constructor, function arg and function return [Nov-11-2007]

badalloc.cpp: catching an exception when new fails [Nov-11-2007]

bad_cast.cpp: incorrect usage of static_cast [Nov-11-2007]

bad_destructor.cpp: demonstrate a class that is unsafe to use with STL because it throws an exception in its destructor [Nov-11-2007]

bad_destructor.cpp: demonstrate a class that is unsafe to use with STL because it throws an exception in its destructor [Nov-11-2007]

bitwise.cpp: Bitwise operators [Nov-11-2007]

bit_fields.cpp: bit fields [Nov-11-2007]

bit_groups.cpp: iostream bitgroups [Nov-11-2007]

bounds.cpp: std::set lower_bound and upper_bound methods [Nov-11-2007]

cast_types.cpp: different C++ casts and their uses [Nov-11-2007]

check_cin.cpp: check the result of cin reading [Nov-11-2007]

class_scope.cpp: names declared in a class are in scope in all functions and constructors of that class [Nov-11-2007]

constructor_exceptions.cpp: exceptions in constructors [Nov-11-2007]

const_madness.cpp: complicated usages of const_cast [Nov-11-2007]

conversions.cpp: Converting constructors and conversion functions [Nov-11-2007]

conversion_inheritance.cpp: Inheritance of conversion functions [Nov-11-2007]

elaborated_specifier.cpp: when an elaborated-type specifier is required to reference a class name [Nov-11-2007]

exit.cpp: exit function ends program without destroying automatic variables [Nov-11-2007]

explicit.cpp: The explicit keyword [Nov-11-2007]

explicit_type_conversion.cpp: explicit type conversions [Nov-11-2007]

extern2.cpp: use extern to declare a variable defined in another translation unit [Nov-11-2007]

file_io.cpp: reading and writing files [Nov-11-2007]

for_each.cpp: std::for_each algorithm [Nov-11-2007]

fraction.cpp: Operator overloading of assignment, arithmetic, relational, stream operators [Nov-11-2007]

friend.cpp: friend functions and classes [Nov-11-2007]

front_back_inserter.cpp: front_inserter and back_inserter [Nov-11-2007]

function_pointer.cpp: function pointers and function references [Nov-11-2007]

function_tryblock.cpp: function try blocks [Nov-11-2007]

functor.cpp: creation and calling of a function object [Nov-11-2007]

good_cast.cpp: dynamic_cast to prevent casting base to wrong child [Nov-11-2007]

implicit_copies.cpp: Implicit copy constructors and assignment operators [Nov-11-2007]

iomanip.cpp: inserting manipulators into an io stream [Nov-11-2007]

istream_iterator.cpp: use an iterator to read a specific type from a stream [Nov-11-2007]

istringstream.cpp: parsing data out of a std::string [Nov-11-2007]

koenig.cpp: Koening Lookup [Nov-11-2007]

lexical_cast.cpp: boost lexical cast, safe conversion from string to number and back [Nov-11-2007]

list_merge.cpp: list::merge member function. Also utilizes predefined-binary predicate function [Nov-11-2007]

list_size.cpp: complexity of the size function of std::list [Nov-11-2007]

literals.cpp: syntax of the different types of literals in C++ [Nov-11-2007]

local_class.cpp: you can define a class inside a function definition [Nov-11-2007]

map_dictionary.cpp: std::map of string keys and string data [Nov-11-2007]

member_init.cpp: Member initialization [Nov-11-2007]

member_reference.cpp: a member variable that is a reference [Nov-11-2007]

member_typedef.cpp: template class with a member typedef using type specified in template [Nov-11-2007]

meta.cpp: meta program to calculate factorials using templates at compile time [Nov-11-2007]

multi_dim_array.cpp: multi-dimensional arrays [Nov-11-2007]

mutable.cpp: demo use of mutable keywod to allow changing member variables of a const object [Nov-11-2007]

namespace_aa.cpp: anonymous namespaces and namespace aliases [Nov-11-2007]

namespace_scope.cpp: names declared in a namespace must precede their usage [Nov-11-2007]

nontype_template.cpp: Template with non-type parameters [Nov-11-2007]

non_dependent.cpp: non-dependent names are not looked for in dependent base classes [Nov-11-2007]

nothrow.cpp: forcing new to return 0 when it fails rather than throw exception [Nov-11-2007]

ostream_iterator.cpp: use an iterator to print to stdout or a file [Nov-11-2007]

ostringstream.cpp: write to a std::string [Nov-11-2007]

overloaded_new.cpp: overloaded operator new [Nov-11-2007]

pointer_add_subtract.cpp: pointer addition and subtraction [Nov-11-2007]

pointer_to_member.cpp: pointers to member variables and member functions [Nov-11-2007]

pp_hash_hash.cpp: ## preprocessing operator to join preprocessing tokens [Nov-11-2007]

private_runtime.cpp: call a private function via polymorphism [Nov-11-2007]

program_options.cpp: boost program options command line parsing [Nov-11-2007]

readstdin.cpp: read one line at a time from stdin [Nov-11-2007]

ref_to_temp.cpp: Binding a reference to a temporary [Nov-11-2007]

regex_match.cpp: boost regex, match a string with a regular expression [Nov-11-2007]

regex_replace.cpp: boost regex, text replacement [Nov-11-2007]

return_ptr_array.cpp: return pointer to array from a function [Nov-11-2007]

sequence_points.cpp: you can only change the value of a variable one time in a statement [Nov-11-2007]

set_strings.cpp: std::set of strings: insert, find, iterate [Nov-11-2007]

shared_ptr.cpp: boost smart pointer [Nov-11-2007]

shift.cpp: shift operators [Nov-11-2007]

specialization.cpp: template specialization and partial specialization [Nov-11-2007]

split_iterator.cpp: boost split iterator, split_iterator [Nov-11-2007]

standard_placement.cpp: standard library placement operator new [Nov-11-2007]

static_member.cpp: static members of a class must be defined outside of the class [Nov-11-2007]

std_merge.cpp: std::merge algorithm [Nov-11-2007]

stl_container_arg.cpp: pass an stl container to function template [Nov-11-2007]

strange_cs.cpp: strange uses of control structures [Nov-11-2007]

string_iterators.cpp: std::string iterators [Nov-11-2007]

string_macro_args.cpp: passing string literals into function like macros [Nov-11-2007]

string_templates.cpp: Strings as template arguments [Nov-11-2007]

template_base.cpp: template inheritance example [Nov-11-2007]

template_deduction.cpp: template argument deduction examples [Nov-11-2007]

template_member_functions.cpp: Template member functions [Nov-11-2007]

template_template.cpp: Template template parameters [Nov-11-2007]

tempvar.cpp: Creation of a temporary object on the stack [Nov-11-2007]

terminate.cpp: setting terminate_handler to handle uncaught exceptions [Nov-11-2007]

test_limits.cpp: obtaining the max-min size of variables at run-time [Nov-11-2007]

throw_spec.cpp: Exception Specifications [Nov-11-2007]

trigraphs.cpp: trigraph sequences are sets of three characters replaced in early phase of compilation [Nov-11-2007]

typename.cpp: case where typename keyword must be used to distinguish between type and static member [Nov-11-2007]

undefined_delete.cpp: defined and undefined uses of delete [Nov-11-2007]

using_directive.cpp: using directive can have local scope [Nov-11-2007]

vector_at.cpp: vector::at is safer than vector's [] operator [Nov-11-2007]

wave.cpp: boost wave C++ preprocessor [Nov-11-2007]

weak_ptr.cpp: std::tr1::weak_ptr, smart pointer type [Nov-11-2007]