Last modified: Thursday, December 8, 2022
static_cast
operator for (preferred) basic type
conversions (type casting); intro to
git
and GitHub
git
!
(Thanks to Stephen Butler
for suggesting this) virtual
methods.virtual
methods/dynamic or late
binding; also some discussion of inheritance and the "big-3"
(destructor, copy constructor, overloaded assignment operator)
Point.h
class definition that now uses
virtual
for methods display
and to_string
Point
and ColorPoint
objects,
for the virtual methods defined in Point.h
above.
ostringstream
and an
istringstream
exc1.cpp
cheesy example of C++ exception-handling
to_string
method to now use an ostringstream
istringstream
to more-easily read point data from a
file to create a vector of Point
objects
iss.cpp
exception
class:
Point
's ==
operator in
ColorPoint
's
==
implementationmain
lightly playing more with ColorPoint
(and Point
, too)
exception
class:ColorPoint
from base class
Point
(see below)main
function
trying out ColorPoint
Point
(see below)search_for
, insert_after
search_for
, insert_after
:
insert_at_front
, print_list
,
and delete_list
insert_at_front
, print_list
,
and delete_list
:
Node
class;
just started an insert_at_front
linked list
function
Node
class (with NodeDataType
of int
):
Node
class during classvector
class, quick examples of some more available formatting
tools
vector
class a bitsetw
and setting precision
desired for displaying double
values)
Team
class (that includes a dynamic array as one
of its data fields)
=
, included here:
http://www.cs.caltech.edu/courses/cs11/material/cpp/donnie/cpp-ops.html
Team
, which has a dynamic array as one
of its data fields, AND now also has
needed "big-3" (destructor, copy constructor,
overloaded assignment operator) added:
Team-test
Team
's dynamic array
data field
players
in its now-added copy constructor
and overloaded assignment operator.
static
to declare a data field that should
only have one instance across all objects of a class
Team
, which has a dynamic array as one
of its data fields, BUT!! has NOT
had needed "big-3" (destructor, copy constructor,
overloaded assignment operator) added yet:
main
function with
demos of a static array of objects, a dynamic array of
objects, a static array of pointers to objects, and a dynamic
array of pointers to objects...! and a little more
->
operator; C++'s keyword this
;
intro to dynamically-allocated arrays
main
function with way-too-many comments
introing and demoing many of today's topics,
including dynamically allocating
(and deallocating) arrays
main
function with examples of
introing and demoing pointers,
introing and demoing dynamic memory allocation
(and deallocation) swap
that uses pass-by-reference parameters:struct
!)
The examples do NOT follow all of our course style standards,
but hopefully these may still be a useful additional reference.
PlayerChar
:
PlayerChar
PlayerChar
:
main
function demonstrating fail
method and
also reading everything
from a file (using getline
and using operator
>>
)print_nums
that is a void
function -- returns nothing,
just has side-effects -- and also has an array
parameter declared as const
:get_nums
that is another void
function -- returns nothing,
just has side-effects -- and also has an array
parameter whose corresponding argument
WILL be changed (was finished after
class):main
uses: guess_word
program, and started review/overview of C++ arrays
word-of-the-day.txt
, and guesses can be logged
over multiple calls in local file guesses_made.txt
word-of-the-day.txt
<<
operator,
of the >>
operator,
and of the getline
function main
function for a
small interactive
guess-a-word program, in progress (but runs!)
main
for this:
is_letter_test.cpp)letter_elsewhere
,
discussing C++ header files a bit more, quick review
of C++ "classic" for
loop, designing
example function guess_match
;
a few words on globbing (using
Linux/Unix wildcards to specify a set of files)
letter_elsewhere
:guess_match
:letter_elsewhere
, including quick review
of C++ if
statement, while
statement,
and more (with some
more CS 112 class style standards mentioned)
letter_elsewhere
;
we'll create its header file
letter_elsewhere.h
and a testing
main
function for it on Thursday main
function testing
our function-in-progress
letter_match
, to be completed in lab tomorrow