Hi.
The main code of the program is not to be changed.
The questions I have are that I am trying to add list1 and list2 together and put it into list 3 with operator +. It is not working for me.
Other thing is bool full (), It is supposed to stop at 20 as that is max size, but it goes over that and does not go to the bool full if it exceeds 20.
Hi,
thanks for that. That did work.
But now in the output, it goes further,
it should output 0 3 6 9 12
but it does 0 3 6 9 12 then random numbers until it reaches a total of 10 outputted.
Do you have any input on the bool full(), on why it doesn´t work for me.
The max for the array size is 20, but when the numbers from 10 to 25 are added it does not activate the bool full function. Instead it just outputs the 25 numbers, instead of 20 and activating the bool full.
bool full() isn't the problem. The problem is add(int i). You add values regardless whether the limit is exceeded or not. You need to check if it is allowed to add something before you actually do it.