[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed

From: John Aldridge
Subject: Re: [Discuss-gnuradio] ANCI-C vs Gnuradio/C++ speeeed
Date: Sat, 13 May 2006 10:55:49 +0100
User-agent: Thunderbird (Windows/20060308)

al davis wrote:
> On Friday 12 May 2006 18:24, Ilia Mirkin wrote:
>> vector<int> x;
>> x[0] = 5;
> Your code is wrong.  The vector x is of size zero.  It should 
> crash.
> You need:
> vector<int> x;
> x.reserve(5);
> x[0] = 5;

You mean resize(5). After a reserve() size is unchanged.

[[Though I've seen the OP's note that his example wasn't intended to be
complete working code]]


reply via email to

[Prev in Thread] Current Thread [Next in Thread]