int i ="";
if (RadioButton1.Checked == true)
{
i = "1";
}
else if (RadioButton2.Checked = true)
{
i = "0";
}
is it correct?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jul 12, 2013, 3:33 AM
Regards,
Iftikar
Hardik PatelPosted Jul 12, 2013, 3:30 AM
cannot implicity convert string to int
Sanjeeb LenkaPosted Jul 12, 2013, 3:11 AM
you can,t assign string value to integer:
int i ="";//Wrong
if (RadioButton1.Checked == true)
{
i = "1";//wrong
}
else if (RadioButton2.Checked = true)//Wrong
{
i = "0";//Wrong
}
correct one:
int i ;
if (RadioButton1.Checked == true)
{
i = 1;
}
else if (RadioButton2.Checked == true)
{
i = 0;
}
Iftikar HussainPosted Jul 12, 2013, 3:03 AM
No, You can do like this
Regards,
Iftikar