Re: Tabs As Syntax

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Tabs As Syntax
De : OFeem1987 (at) *nospam* teleworm.us (Chris Ahlstrom)
Groupes : comp.os.linux.advocacy
Date : 22. Mar 2024, 14:20:11
Autres entêtes
Organisation : None
Message-ID : <utjt1t$2tns5$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : slrn/1.0.3 (Linux)
rbowman wrote this copyrighted missive and expects royalties:

On Thu, 21 Mar 2024 10:10:33 -0400, Chris Ahlstrom wrote:
>
for (int n : { 2, 4, 6, 8 })
    std::cout << n << ", ";
 
std::cout << "who do we appreciate?" << std::endl
 
(std::endl is \n with a flush.
>
cout never did much for me either. That's one of the areas that seemed
like a gratuitous departure from C.
>
Then there is the Python
>
print("Never again!", end="\r")

operator << is useful with std::ostringstream when you want to avoid having
deal with allocating enough output space. Still, I use this a lot:

    char temp[32];
    snprintf(temp, sizeof temp, "We have %d idiots here", idcount);

Sometime a printf specification is just easier to read.

The GNU compiler will even warn if the buffer isn't big enough to hold
the largest possible result.

--
Gratitude and treachery are merely the two extremities of the same procession.
You have seen all of it that is worth staying for when the band and the gaudy
officials have gone by.
-- Mark Twain, "Pudd'nhead Wilson's Calendar"

Date Sujet#  Auteur
22 Mar 24 * Re: Tabs As Syntax14rbowman
22 Mar 24 +* Re: Tabs As Syntax11Chris Ahlstrom
22 Mar 24 i+* Re: Tabs As Syntax2candycanearter07
22 Mar 24 ii`- Re: Tabs As Syntax1Chris Ahlstrom
23 Mar 24 i`* Re: Tabs As Syntax8Lawrence D'Oliveiro
23 Mar 24 i `* Re: Tabs As Syntax7Chris Ahlstrom
23 Mar 24 i  +* Re: Tabs As Syntax5DFS
23 Mar 24 i  i+- Re: Tabs As Syntax1rbowman
24 Mar 24 i  i+- Re: Tabs As Syntax1Lawrence D'Oliveiro
24 Mar 24 i  i`* Re: Tabs As Syntax2Chris Ahlstrom
24 Mar 24 i  i `- Re: Tabs As Syntax1Physfitfreak
23 Mar 24 i  `- Re: Tabs As Syntax1rbowman
27 Mar 24 `* Re: Tabs As Syntax2DFS
28 Mar 24  `- Re: Tabs As Syntax1rbowman

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal