MinnisotaFreezing
Programmer
Hey,
I have written and seen if statments writen both of the following ways:
CString string = "Happy";
if (string.GetLength() != 0)
DoSomthing
and
if (int ret = string.GetLength() != 0)
DoSomthing
As far as I can tell, they both work the same way, but it seems like MSDN prefers the second way. I like the first because it is shorter. Any arguments for or against either one?
CJB
I have written and seen if statments writen both of the following ways:
CString string = "Happy";
if (string.GetLength() != 0)
DoSomthing
and
if (int ret = string.GetLength() != 0)
DoSomthing
As far as I can tell, they both work the same way, but it seems like MSDN prefers the second way. I like the first because it is shorter. Any arguments for or against either one?
CJB