| delorie.com/archives/browse.cgi | search |
| Message-ID: | <377B9DAE.2D051E9@calderathin.com> |
| Date: | Thu, 01 Jul 1999 10:56:14 -0600 |
| From: | Jared Stevens <stevja AT calderathin DOT com> |
| X-Mailer: | Mozilla 4.6 [en] (Win95; I) |
| X-Accept-Language: | en |
| MIME-Version: | 1.0 |
| To: | djgpp AT delorie DOT com |
| Subject: | Re: Argument problem |
| References: | <7lfub9$b64 AT nnrp1 DOT farm DOT idt DOT net> |
| Reply-To: | djgpp AT delorie DOT com |
int main(int argc, char *args[]) {
if (args[1] == "hello") cout<<"Hello";
return 0;
}
As far as I know, you can't compare strings like that...
(args[1]=="hello"), try:
if(strcmp(args[1], "hello")==0) cout << "Hello";
Jared Stevens
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |