class
MAP[G]
create
make
feature --attributes
g_array: ARRAY[G]
size:INTEGER
feature{NONE}
make
do
g_array.make_empty
size:=0
end
class
MAP_TESTING
m: MAP[INTEGER]
create m.make
print(m.size)
The first class consist of an array and its size. When I tried to create an m
object of ARRAY, nothing seems to be printing out when I put print(m.size)
. Am I instantiating the array correctly? Am I using the correct make
function for ARRAY
? Why isn't it printing anything?
---------------------------
class
MAP[G]
create
make
feature --attributes
g_array: ARRAY[G]
size:INTEGER
feature{NONE}
make
--I left this blank
end
class
MAP_TESTING
m: MAP[INTEGER]
create m.make
print(m.size)
This actually works when I left the make
blank. It prints out 0
. But this is no good because obviously if I call other functions using the array in MAP
, it won't work. I actually tried using other functions from the class ARRAY, but I got a compile error.