Deutsch English Français Italiano |
<vc9l5e$2ue0d$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Muttley@dastardlyhq.com Newsgroups: comp.lang.c++,alt.comp.lang.c++.misc Subject: Re: Counting Characters!! Date: Mon, 16 Sep 2024 16:08:14 -0000 (UTC) Organization: A noiseless patient Spider Lines: 26 Message-ID: <vc9l5e$2ue0d$1@dont-email.me> References: <vc34i0$3rnbg$1@paganini.bofh.team> <vc4oti$1kk40$5@dont-email.me> <vc9kck$2u6ef$1@raubtier-asyl.eternal-september.org> Injection-Date: Mon, 16 Sep 2024 18:08:14 +0200 (CEST) Injection-Info: dont-email.me; posting-host="af621b2752410409389c7001e7281de9"; logging-data="3094541"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FSoBacEUYemxf73dAfM7a" Cancel-Lock: sha1:TivIKndgKzM16avGN/5wTL+r1xY= Bytes: 1529 On Mon, 16 Sep 2024 17:55:02 +0200 Bonita Montero <Bonita.Montero@gmail.com> boringly babbled: >Am 14.09.2024 um 21:41 schrieb Chris Ahlstrom: >> DMZ wrote this copyrighted missive and expects royalties: >> >>> This simple program will count characters for you!! >>> >>> #include <stdio.h> >>> >>> int main() >>> { >>> printf(" = %d characters", printf("Hello World!")); >>> >>> return 0; >>> } >> >> Cute. >> > >Nice, but this counts the characters at compile-time: > > std::string_view sv( "Hello World!" ); > std::cout << sv << " = " << sv.length() << " characters" << endl; So does sizeof("Hello world!");