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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 11, 2013, 11:03 PM EDT
No, You can do like this
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 11, 2013, 11:11 PM EDT
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;
}
Hardik PatelRank #4,439 · 343 reputationPosted Jul 11, 2013, 11:30 PM EDT
cannot implicity convert string to int
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 11, 2013, 11:33 PM EDT
Regards,
Iftikar