Article View: comp.lang.c
Article #232Re: compare literals / if( "cat"== "dog") {}
From: Kenny McCormack
Date: Sun, 11 Oct 2026 20:28
Date: Sun, 11 Oct 2026 20:28
22 lines
1667 bytes
1667 bytes
In article <1791743331-5857@newsgrouper.org>,
MitchAlsup <user5857@newsgrouper.org.invalid> wrote:
>
>fir <profesor.fir@gmail.com> posted:
>-------------------
>>
>> if("cat" == "cat") will return true and
>> if("cat" == "dog") will return false
>
>"cat" in C means a pointer p points at {'c' 'a' 't' 00} in memory; so,
>if you want character comparison you want:
>
> if( strcmp( "cat", "dog" ) == 0 ) //cat = dog
That's a different thing. That's not what we are talking about in this
thread.
Suggest you start a new thread to discuss the "strcmp" function.
--
It's possible that leasing office space to a Starbucks is a greater liability
in today's GOP than is hitting your mother on the head with a hammer.
Technical Details
Message-ID:
<11agrh8$3r7pl$1@news.xmission.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.nrbbs.org!csiph.com!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mailReferences:
<11ae962$2365v$1@dont-email.me> <1791743331-5857@newsgrouper.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.nrbbs.org!csiph.com!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: compare literals / if( "cat"== "dog") {}
Date: Sun, 11 Oct 2026 20:28:24 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <11agrh8$3r7pl$1@news.xmission.com>
References: <11ae962$2365v$1@dont-email.me> <1791743331-5857@newsgrouper.org>
Injection-Date: Sun, 11 Oct 2026 20:28:24 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="4038453"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)