I have a problem relating to arrays in Windows Form Application. The problem is that I don't know if it's possible to do math with them, and if so how?
Let's say that I have declared something like this int[] price = new int[] { 10, 12, 7, 11 };
What I want to do with these arrays is to add them together depending on if the required checkbox is checked.
'
Let's say if I check the first and third checkbox, the first and third array should add up.
I want the sum of the checked arrays where it says "Kostar : [0]".
The output label is named: kostarLbl.
I have tried it myself, but I know far too little to acually solve it :(
If you have any questions, feel free to ask them!
int total = 0; foreach (int i in price) total += i; Kostar.Value = total;