Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Leda > Re: Difference ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 122 of 212
Post > Topic >>

Re: Difference Between C++ and Visual C++

by Stefan Wolfsheimer <wolfs019@[EMAIL PROTECTED] > Apr 13, 2004 at 03:38 PM

Sonia wrote:
> Why does C++ return 0 and Visual C++ return 1 when I execute this
> program?  Why the difference if they are both MS products?

I don't know which compiler exactly you mean with "C++"?

I guess, you want to compare 2 strings.
Try the function strcmp in <string.h> or more c++-like:

#include <iostream>
#include <string>
  using namespace std;

  void main()
  {
       cout<< string("123")<= string("89") <<endl;
  }


If you compare "123" with "84", you compare 2 pointers of char (char*). 
String constants are pointer of char.

----
Stefan
 




 2 Posts in Topic:
Difference Between C++ and Visual C++
sonia_galvan@[EMAIL PROTE  2004-04-06 21:26:27 
Re: Difference Between C++ and Visual C++
Stefan Wolfsheimer <wo  2004-04-13 15:38:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 15:44:30 CDT 2008.