delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/01/21:51:06

Newsgroups: comp.os.msdos.djgpp
From: manfred DOT heumann AT uni-bielefeld DOT de (Manni Heumann)
Subject: Re: Argument problem
References: <7lfub9$b64 AT nnrp1 DOT farm DOT idt DOT net>
X-Newsreader: News Xpress 2.01
Date: Thu, 01 Jul 1999 15:32:02 GMT
NNTP-Posting-Host: psyreha1.uni-bielefeld.de
Message-ID: <377b89f7.0@news.uni-bielefeld.de>
X-Trace: 1 Jul 1999 17:32:07 +0200, psyreha1.uni-bielefeld.de
Lines: 19
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <7lfub9$b64 AT nnrp1 DOT farm DOT idt DOT net>, "Tom Beauchamp" <tomtomb AT geocities DOT com> wrote:
>int main(int argc, char *args[]) {
>    if (args[1] == "hello") cout<<"Hello";
>    return 0;
>}
>
>Produces no output when called with "program hello". Why not? Is it because
>I didn't compare it to "hello\o"?  Please Help
>
>Tom Beauchamp
>
No, it's because comparing c-strings ain't that simple. You will have to 
#include <string.h> and get familiar with the strcmp () function.



--

Manni

- Raw text -


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