🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #309754

Re: Dwa wykrzykniki

#309754
From: Queequeg
Date: Tue, 23 Oct 2018 11:39
17 lines
1397 bytes
Wojciech Muła <wojciech_mula@poczta.onet.pl> wrote:

>> Poinformowanie programisty, że używana jest wartość boolean.
> 
> Ciekawostka z C++: +!!"" == 1.

W C też tak jest.

`""` to wskaźnik na pusty string. Zawsze będzie niezerowy.

`!!` robi z niego 1.

`+` jest niepotrzebny -- w tej roli to znak liczby (jakby było `-!!""` to 
byłoby -1).

-- 
https://www.youtube.com/watch?v=9lSzL1DqQn0
Technical Details
Message-ID: <110bbad2-4206-4e20-8ae7-915d255aa0f9@trust.no1>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.chmurka.net!.POSTED.pi.v.chmurka.net!not-for-mail
References: <pnd9do$6aj$1@node2.news.atman.pl> <bbee6294-eca8-4bb7-8daa-6e2784b94b4e@trust.no1> <2cf220f2-06e8-41a4-b36a-0526ee9a5bd0@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.chmurka.net!.POSTED.pi.v.chmurka.net!not-for-mail
From: queequeg@trust.no1 (Queequeg)
Newsgroups: pl.comp.lang.c
Subject: Re: Dwa wykrzykniki
Date: Tue, 23 Oct 2018 11:39:10 +0000 (UTC)
Organization: news.chmurka.net
Message-ID: <110bbad2-4206-4e20-8ae7-915d255aa0f9@trust.no1>
References: <pnd9do$6aj$1@node2.news.atman.pl> <bbee6294-eca8-4bb7-8daa-6e2784b94b4e@trust.no1> <2cf220f2-06e8-41a4-b36a-0526ee9a5bd0@googlegroups.com>
NNTP-Posting-Host: pi.v.chmurka.net
Mime-Version: 1.0
Injection-Date: Tue, 23 Oct 2018 11:39:10 +0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="gof"; posting-host="pi.v.chmurka.net:172.24.44.20"; logging-data="20212"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (Linux/4.4.50-v7+ (armv7l))
Cancel-Lock: sha1:4Un9Oh+JI9bWQS0FYc7DqsXA/4Q=
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit