Friday, February 12, 2010

Question regarding Visual Basic 6.0: Is the condition ';Hello '; = ';Hello'; true or false?

Hello guys,





I am doing a VB assignment %26amp; can you please explain me this above question?





NOTE the space in the condition ';Hello ';


ThanksQuestion regarding Visual Basic 6.0: Is the condition ';Hello '; = ';Hello'; true or false?
In any computer language the = sign is an operator. The = puts the value of ';Hello'; (no space) into the variable. Since we can't have variables with quote marks, nothing is done. Two equals == will compare and return a boolean true/false value. And, think of == saying ';the same as'; a == bQuestion regarding Visual Basic 6.0: Is the condition ';Hello '; = ';Hello'; true or false?
The two are not equal as you are comparison is one of strings. The first string has an extra space and thus is not the same as the second condition which does not.

No comments:

Post a Comment