I have a small problem regarding arrays.
This is the code:
char[] select = new char[] { '+', '-', '/', '%' };
var rand = new Random();
char num = select[rand.Next(5)];
I have five CheckBox controls. If my control named checkboxadd is checked, I want the array to have the value of { + }. And if my controls named checkboxadd and checkboxsubtract are checked, I want the value of the array to change to { +, - }. And so on.
Is this possible?
More: I am creating a Windows Forms application. The application is an arithmetic learning system which offers a set of operations which are selected via CheckBox controls. I think my approach is wrong...can anyone help?
selectis a reserved keyword. You should escape it using@selector use a different name for the variable.