🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Jak wołać konstruktor z konstruktora?

#308526
From: Borneq
Date: Tue, 10 May 2016 06:03
26 lines
1683 bytes
W dniu 10.05.2016 o 00:05, bartekltg pisze:
>     fu(int A, int B, int C)
>     {
>         a=A;
>         b=B;
>         c=C;
>     };
>     fu(int A): fu(A,A,A) {};

A co gdy mamy najpierw wyliczać argumenty a dopiero POTEM podać do 
konstruktora?

fu(istream stream, int size, int position)
{
   wczytywanie ze strumienia stream od pozycji position, do bufora,
   którego rozmiar jest nie większy niż size-position
}

fu(istream stream)
{
   wyliczanie pozycji za pomocą tellg()
   ustawienie się na końcu za pomocą stream.seekg(0, ios::end);
   wyliczenie rozmiaru za pomocę tellg()
   ustawienie się w poprzedniej pozycji: stream.seekg(position,ios::beg);
   dopiero teraz mamy wołać konstruktor trójargumentowy
}
Technical Details
Message-ID: <ngrtjt$m40$1@node2.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <ngqsgh$nj4$1@node2.news.atman.pl> <ngr1k7$ne3$1@node1.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Borneq <borneq@antyspam.hidden.pl>
Newsgroups: pl.comp.lang.c
Subject: Re: Jak wołać konstruktor z konstruktora?
Date: Tue, 10 May 2016 08:03:41 +0200
Organization: ATMAN - ATM S.A.
Lines: 26
Message-ID: <ngrtjt$m40$1@node2.news.atman.pl>
References: <ngqsgh$nj4$1@node2.news.atman.pl> <ngr1k7$ne3$1@node1.news.atman.pl>
NNTP-Posting-Host: 91.239.205.105
Mime-Version: 1.0
X-Trace: node2.news.atman.pl 1462860221 22656 91.239.205.105 (10 May 2016 06:03:41 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Tue, 10 May 2016 06:03:41 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0
In-Reply-To: <ngr1k7$ne3$1@node1.news.atman.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit