N
noname
char c ='\0';
string cstr = "";
string cstr2;
cstr2 =cstr + c;
//Debugger watch on cstr2.Length shows 0
if( cstr2.Length == 0)
{
MessageBox.Show ("in if",
cstr2,MessageBoxButtons.OKCancel,
MessageBoxIcon.Asterisk);
}
else
{
MessageBox.Show ("in else",
cstr2,MessageBoxButtons.OKCancel,
MessageBoxIcon.Asterisk);
}
why does this execute the else clause
string cstr = "";
string cstr2;
cstr2 =cstr + c;
//Debugger watch on cstr2.Length shows 0
if( cstr2.Length == 0)
{
MessageBox.Show ("in if",
cstr2,MessageBoxButtons.OKCancel,
MessageBoxIcon.Asterisk);
}
else
{
MessageBox.Show ("in else",
cstr2,MessageBoxButtons.OKCancel,
MessageBoxIcon.Asterisk);
}
why does this execute the else clause