Something that has always annoyed me about managed C++ is not having the ability to compare strings like
instead you have to use code likeCode:String^ c = "this"; String^ d = "that"; if (c == d) {}
Why is this? And why does 0 equal true? hasn't 1 always been the value that equals true? Why did they have to change the entire language. It doesn't even resemble ANSI C++.Code:String^ c = "this"; String^ d = "that"; if (String::Compare(c,d) == 0) { .... }
Not sure why they changed it like that but it annoys me as well. True is now 0 because anything other than 0 is false. That means it can be -12000 or 100 to be false.
Uhh...doesn't strcmp use the same returns?
Its not just String::Compare but everything now returns 0 for true in managed C++.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks