delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/27/07:08:57

Date: Wed, 27 May 1998 11:48:12 +0200 (MET DST)
From: Federico Spinazzi <federico AT SysPr03 DOT disat DOT unimi DOT it>
To: Clint Allen <clint DOT allen AT mci2000 DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: C command line options
In-Reply-To: <CyQa1.113$mR4.91692@news.internetmci.com>
Message-ID: <Pine.LNX.3.93.980527113648.12693A-100000@SysPr03.disat.unimi.it>
MIME-Version: 1.0

On Wed, 27 May 1998, Clint Allen wrote:

>   if (argv[1] == "/nts")
If you are compiling in C this is incorrect: use if (strcmp(argv[1],
"/nts") == 0) instead;
You are using C++ (as // comments suggest) the == operator for array of
char it shouldn't work as you expect. I don't know C++ very well but
string comparison could be made with == operator if you declare the
arguments of the == operator as string class objects (I really don't know
how you can declare them, but for a C++ programmers should be very
simple).
I think that your code is not comparing the 'strings' at all but something
else I can't tell what.

Hope to be right.

Federico

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019