adding value together.
so:
1 + 0 = 1
3 + 1 = 4
4 + 4 = 8
How do I get this, so that it starts off at 0, and i type in 1 into a txtbox, so it adds 1 to the total, next i type in 3, so it adds 3 to the total, which eqauls 4, now i type 4, and it adds 4 to the total, which means its at 8 now.
How do i write the code to keep adding to its self?
That sounds like homework, so I’ll put the answer on a level so I don’t give you the answer, but rather point out a direction.
The core problem is that you will need to store the value, so that it is available when you want to add the next number to it. If you declare a local variable inside a method, it gets initialized each time the method runs. So instead you will need to hold the value somewhere outside of the method, such as in a class field. Then you can simply add the value from the text box to the field by
int)