Article View: be.comp.programming
Article #3183Re: [C++] Direct intitialiseren van elementen in een vector
From: Luc Kumps
Date: Fri, 23 Jan 2004 10:12
Date: Fri, 23 Jan 2004 10:12
21 lines
1572 bytes
1572 bytes
Oelewapperke wrote:
> Luc Kumps wrote:
>
>> Oelewapperke wrote:
>>> int a[] = {3,0,9,8,2};
>>>
>>> int main() {
>>> vector<int> v(a, a+5);
>>
>> Iets algemener is
>>
>> vector<int> v(a, a+sizeof(a)/sizeof(*a));
>>
>> Luc K
>
> voorzichtig zijn met sizeof ...
Kun je iets specifieker zijn?
Enkel bij het oversteken van de straat of ook om andere redenen?
Luc K
Technical Details
Message-ID:
<Gs6Qb.1413$Cg4.95326@phobos.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.arcor-online.net!feed1.news.be.easynet.net!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mailReferences:
<pan.2004.01.22.10.26.37.526679@ua.ac.be> <1074808734.185439@seven.kulnet.kuleuven.ac.be> <2Y3Qb.1181$pf4.39976@phobos.telenet-ops.be> <1074849382.258647@seven.kulnet.kuleuven.ac.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,ded1fa205e24133a X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2004-01-23 02:12:55 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.arcor-online.net!feed1.news.be.easynet.net!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail From: "Luc Kumps" <NOkumpsSPAM@pandora.be> Newsgroups: be.comp.programming References: <pan.2004.01.22.10.26.37.526679@ua.ac.be> <1074808734.185439@seven.kulnet.kuleuven.ac.be> <2Y3Qb.1181$pf4.39976@phobos.telenet-ops.be> <1074849382.258647@seven.kulnet.kuleuven.ac.be> Subject: Re: [C++] Direct intitialiseren van elementen in een vector Lines: 23 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <Gs6Qb.1413$Cg4.95326@phobos.telenet-ops.be> Date: Fri, 23 Jan 2004 10:12:54 GMT NNTP-Posting-Host: 213.118.67.142 X-Complaints-To: abuse@telenet.be X-Trace: phobos.telenet-ops.be 1074852774 213.118.67.142 (Fri, 23 Jan 2004 11:12:54 MET) NNTP-Posting-Date: Fri, 23 Jan 2004 11:12:54 MET Organization: Telenet Internet