===================================== C++ - Examples/ TABLE OF CONTENTS Sep. 15, 2015 ===================================== This directory contains a collection of programs and writeups that will be of interest (and aid) to students who are learning C++. (Many of these samples have not yet been updated to conform with ANSI C++. I am modifying them as quickly as I can...) FILE or DIRECTORY/ DESCRIPTION ------------------ ------------------------------------------------------ 00INDEX.txt - This file ADTvsAbsCls.rtf - The difference between an ADT and an Abstract Class ANSIString.cpp - Demonstrate ANSI strings and their use Answers.txt - A data file for homework ArrayOfArrays.cpp - Demonstrate 2D arrays and array of arrays Arrays.cpp - Using 1-D arrays ArrayTest.c - Demonstrate array overrun Binary.cpp - Binary Search in a 1-D Array Battleship/ - Simple battleship game BinSrchFlwchrt.ppt - Binary Search Structured Flowchart CardClas/ - Using CLASS CardClas.cpp - Implementation file CardClas.h - Header file RunCards.cpp - Main program BlowHeap.cpp - Demonstrate running out of dynamic memory (heap space) BlowStack.cpp - Demonstrate running out of runtime stack space BubbleSort.cpp - Simple implementation of the bubblesort algorithm Cards.cpp - Using STRUCT ChangeCout/ - How to redirect cout (cin) from within a C++ program ChangeCout.cpp - Main program CLists.c - Forward-directed, singly-linked Lists (C) CLists.cpp - Forward-directed, singly-linked Lists (C++) friends Complex.cpp - Three ways to overload operators Const.cpp - Variations on CONST and POINTER CopyCons.cpp - Copy Constructor CVirtual.cpp - 'virtual' and polymorphism DemoEof.cpp - EOF failure in CodeWarrior Develop.rtf - The Development Processes summary Duality.cpp - Duality of IF and SWITCH Encoded.txt - A data file for homework FcnArg.cpp - Passing a Function as an Argument FcnPtr.cpp - Using (arrays of) Function Pointers FunctionPointer.cpp - Using an array of function pointers FSMInfo.zip - Finite State Machines Handout HexFSM.rtf - Finite State Machines: Hex Numbers Inherit.cpp - Example of inheritance Iostream.html - - Copy from the Library Lists.cpp - List of Lists of C++ strings using STL Louie/ - How to use UNIX 'make' and 'makefile' Makefile.rtf - Summary of all the files in Louie\ Makefile/ - How to use UNIX 'make' and 'makefile' ByHand.txt - How to create a multi-file program in C++ Makefile.rtf - Summary of all the files in Makefile\ MiniDD1.cpp - Mini Dungeons & Dragons - OOD #1 MiniDD2.cpp - Mini Dungeons & Dragons - OOD #2 Minimum.cpp - Using the Ternary ? Operator Mortgage3.cpp - Computing a interest/mortgage/amortization table NDNew.cpp - Dynamic Allocation of N-D Arrays NewDelete.cpp - Show how to overload the new and delete operators Number.c - A C program demonstrating how to acquire a number safely OOD1.rtf - Object Oriented Design, Part I OOD2.rtf - Object Oriented Design, Part II Passage7.txt - A data file for homework PlayingWithBits.c - Demonstrate some bit-shifting operations PointersArraysInC.pdf - A medium-to-advanced description of C pointers and arrays PrePost.cpp - Prefix and Postfix Increment and Decrement Primes.cpp - Finding Prime Numbers PuPrPv.cpp - Public Protected Private accessibilities Random.c - How to use Random Numbers in C Random.cpp - How to use Random Numbers RandomSeed.cpp - How to SEED the Random Number Generator RecordIO.cpp - Using record (binary) input/output Redirect.cpp - Using Redirection in CodeWarrior Redirection.rtf - Using Redirection; capturing output (Java/C++) Reopen.cpp - Reopening a file in CodeWarrior Reversed.cpp - Using Recursion Rhombus.cpp - Controlling Output Layout Round.c - Demonstrate rounding SimpCalc.cpp - A Simple Interpreter (calculator) Stack1.zip - A simple template Stack implementation using accessors Stack2.zip - A simple template Stack implementation using friends String.html - - Copy from the C++ library StringDescr.html - Descriptions of the string.h functions Stringy.cpp - The Stringy class; copy constructor; assignment overload Template.cpp - Tiny Template Example TimeClas.cpp - Setting up a Simple CLASS TimeStamp.zip - A Visual C++ v6.0 project showing how to "timestamp" files ToFromString.cpp - How to convert data to/from a string TwoThreeD.c - Demonstrate how to pass 2-D and 3-D arrays to functions Typedef.cpp - How to use typedef Unions.cpp - How to use a union ValRef.cpp - Difference between call-by-value and call-by-reference Vectors.cpp - Demonstrate use of STL vectors VectorIteration.cpp - Demonstration iterating through an STL vector Vehicle.cpp - Tiny example of a "vehicle" class Virtual.cpp - Virtual functions and virtual destructors VirtualBase.cpp - Importance of declaring a base destructor 'virtual' - o - O - o - File: http://Snow.SierraNevada.edu/~csci/Examples/00INDEX.txt Mirror: http://www.snc-csci.com/~csci/Examples/00INDEX.txt Last updated: 3:35 PM 10/31/2014