about
12/06/2022
CppBasicDemos Repo
CppBasicDemos code

CppBasicDemos  Repository

A good source for practice code

Quick Status Code functions correctly no known defects Demonstration code yes Documentation yes Test cases none planned Static library none planned Build requires C++17 option Planned design changes - Revise DemComp & DemInherit
- Add GraphWalk demo

1.0 Contents

Basic demos for C++ Tooling
  • CMakeDemo
    How to use CMake with hierarchal and non-hierarchal configurations.
Basic demos for C++ syntax:
  • PointersAndReferencesDemo
    Basic syntax and use of pointers and C++ references.
  • LambdaCapture
    Lambdas are a short-cut syntax for creating functors.
  • CallableObjects-SimpleDemo
    Callable objects are any C++ construct with invocation syntax, e.g., function, function pointer, functor, and lambda.
  • StorageSizes
    Evalulates sizes of the C++ fundamental types in CppBasicDemos > TypeTests > StorageSizes
  • CastTests
    Demonstrates each of the modern cast types in CppBasicDemos > TypeTests > CastTests
Basic Demos for C++ classes:
  • Equiv
    Construction syntax that is context dependent and may be confusing for those new to C++
  • ClassLayout
    Class Layout in memory - illustrates that inheritance and composition create nested instances.
    Instance Layout
  • DemComp
    Illustrates basic composition syntax and use of constructor initializers.
  • DemInherit
    Inheritance demos illustrate the importance of specifying base and component initialization using constructor initializer sequences.
  • DemInit
    Initialization syntax demos.
Basic Demos for C++ libraries:
  • iostreams
    std::iostreams - console, files, filebuf, and stringstream demos.
  • STL containers
    Simple operations for each of the STL containers.
  • TreeWalk
    TreeWalk - demonstrate tree walks with recursion, stacks, and queues.
  • GraphWalk
    GraphWalk - demonstrate graph walks with recursion, stacks, and queues. This requires tracking visited nodes.

2.0 Build

This C++ code was built with Visual Studio Community Edition - 2019 and tested on Windows 10.
  Next Prev Pages Sections About Keys