Lost Password?


  #1 (permalink)  
Old 07-19-2006, 06:31 PM
NeedHelp NeedHelp is offline
Programming God
 
Join Date: May 2006
Posts: 527
Rep Power: 13
NeedHelp is on a distinguished road
Default String::Compare

Something that has always annoyed me about managed C++ is not having the ability to compare strings like

Code:
String^ c = "this";
String^ d = "that";

if (c == d) {}
instead you have to use code like

Code:
String^ c = "this";
String^ d = "that";

if (String::Compare(c,d) == 0) {
....
}
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++.
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-20-2006, 07:08 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,648
Last Blog:
PHP Objects, Patterns,...
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

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.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-27-2006, 04:01 PM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Rep Power: 11
brackett is on a distinguished road
Default

Uhh...doesn't strcmp use the same returns?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-28-2006, 07:00 PM
RobSoftware RobSoftware is offline
Programmer
 
Join Date: Nov 2005
Posts: 143
Rep Power: 12
RobSoftware is on a distinguished road
Default

Its not just String::Compare but everything now returns 0 for true in managed C++.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 05:47 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads