can someone explain me what this code does???
if (numBuses == 0)
buses = new int *[1];
if the number of busses is equal to 0 then
create a new integer array pointer
and
make it to point on the 2nd item of the array
( cuz array index starts from 0,1,2… and normally pointers when given an array point towards the first item in the array)
if (numBuses == 0)
buses = new int *[1];
please ask if any doubts
Thank you
regards Karan Gowda
Pretty sure that is incorrect. I believe it is initializing an array of int pointers with size 1 (allocating memory for that array of int pointers) and assigning that array to the variable buses.