Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- string comparison bug
- Matija Papec
May 6, 2010, 11:13 am
rate this thread
Re: string comparison bug
Actually - yes. :)
There is an explanation of your "problem":
"If you compare a number with a string or the comparison involves
numerical strings, then each string is converted to a number and the
comparison performed numerically."
So, this two strings will be converted to the integers and then they
will be compared. Their integer values are same in both cases - 2.
You can use strict comparison (=3D=3D=3D) or "strcmp" function to get what