Chapter Eight : new and delete

EXAMPLE 8.1 page no : 89

In [1]:
sp = "Hello" 
arraySize = 5;
sa = []
print sp, arraySize
Hello 5

EXAMPLE 8.2 page no : 90

In [2]:
sp = "Hello"
print sp
Hello

EXAMPLE 8.3 page no : 90

In [3]:
class W:
    def __init__(self):
        pass

    def goAway(self):
        pass
        
    def foo(self):
        pass
    
    def bar(self):
        pass

EXAMPLE 8.4 page no : 91

In [4]:
maxSize = 100; # get storage for object
storage = [] # call placement new to create object
 

EXAMPLE 8.5 page no : 93

In [5]:
class BadArgument:
    def __init__(self):
        pass

class A:
    def __init__(self):
        pass
In [ ]: