Exercises
-
10.6 (Memory Allocation and Deallocation Operators) Compare and contrast dynamic memory allocation and deallocation operators
new
,new []
,delete
anddelete[]
. -
10.7 (Overloading the Parentheses Operator) One nice example of overloading the function call operator
()
is to allow another form of double-array subscripting popular in some programming languages. Instead of sayingchessBoard[row][column]
for an array of objects, overload the function call operator to allow the alternate form
chessBoard(row, column)
Create a class
DoubleSubscriptedArray
that has similar features to classArray
in Figs. 10.10–10.11. At construction time, the class should be able to create aDoubleSubscriptedArray
of any number of rows and columns. ...
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.