🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux.programowanie
Article #60169

Re: Jak zrobić program obliczający dużą silnię?

#60169
From: Jedrzej Dudkiewicz
Date: Wed, 26 Oct 2005 13:31
20 lines
1882 bytes
> Wyglądało mi na to, że autor chciał uniknąć sytuacji z "goto", w których
> musi przy wielu miejscach powrotu z funkcji skasować zarezerwowaną pamięć.

Nie wiem, czy ktoś to zrozumiał. Chodziło o coś takiego:

int fun()
{
    char* to = malloc(100);
    char* tamto = malloc(50);
    if(...)
        for(...)
            goto end;
    end:
    free(to);
    free(tamto);
}

Taka symulacja destruktorów.

JD
Technical Details
Message-ID: <djo0g6$vk3$1@news.supermedia.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!news.supermedia.pl!not-for-mail
References: <djfrn5$i55$1@nemesis.news.tpi.pl> <dji80k$2a5$2@atlantis.news.tpi.pl> <20051024135514.GA237@siebert> <djij31$st1$1@sunnews.cern.ch> <20051024162624.GA1132@siebert> <djleog$fok$1@nemesis.news.tpi.pl> <1t4bv9mozvw38.12szxw58iqmbp.dlg@40tude.net> <djn9lh$ktl$1@nemesis.news.tpi.pl> <djnq2f$9i4$1@inews.gazeta.pl> <djnqvu$be7$2@atlantis.news.tpi.pl> <djntuu$1l4$1@inews.gazeta.pl> <djnu60$s25$1@atlantis.news.tpi.pl> <djnveg$a4j$1@inews.gazeta.pl> <djo0bh$vh2$1@news.supermedia.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!news.supermedia.pl!not-for-mail
From: "Jedrzej Dudkiewicz" <jedrzej.dudkiewicz@poczta.interia.pl>
Newsgroups: pl.comp.os.linux.programowanie
Subject: Re: Jak zrobić program
 obliczający dużą silnię?
Date: Wed, 26 Oct 2005 15:31:48 +0200
Organization: SuperMedia - http://www.sm.pl
Lines: 21
Message-ID: <djo0g6$vk3$1@news.supermedia.pl>
References: <djfrn5$i55$1@nemesis.news.tpi.pl> <dji80k$2a5$2@atlantis.news.tpi.pl> <20051024135514.GA237@siebert> <djij31$st1$1@sunnews.cern.ch> <20051024162624.GA1132@siebert> <djleog$fok$1@nemesis.news.tpi.pl> <1t4bv9mozvw38.12szxw58iqmbp.dlg@40tude.net> <djn9lh$ktl$1@nemesis.news.tpi.pl> <djnq2f$9i4$1@inews.gazeta.pl> <djnqvu$be7$2@atlantis.news.tpi.pl> <djntuu$1l4$1@inews.gazeta.pl> <djnu60$s25$1@atlantis.news.tpi.pl> <djnveg$a4j$1@inews.gazeta.pl> <djo0bh$vh2$1@news.supermedia.pl>
NNTP-Posting-Host: 212.180.147.46
Mime-Version: 1.0
X-Trace: news.supermedia.pl 1130333510 32387 212.180.147.46 (26 Oct 2005 13:31:50 GMT)
X-Complaints-To: abuse@supermedia.pl
NNTP-Posting-Date: Wed, 26 Oct 2005 13:31:50 +0000 (UTC)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
X-Priority: 3
X-MSMail-Priority: Normal
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit