discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Multiplicative constant vector for multiply_const


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Multiplicative constant vector for multiply_const_vcc
Date: Fri, 22 May 2015 00:45:10 +0200
User-agent: K-9 Mail for Android

I think this might simply be a matter of out-of-boundary access on std:: vector. You don't set a size on your vector at creation, so it might have zero elements, of which you try to set the first by doing k[0]. That means you access memory that is not yet there, I.e. a segmentation fault. Try k.push_back!

Best regards,
Marcus

Am 21. Mai 2015 14:13:16 MESZ, schrieb "khalid.el-darymli" <address@hidden>:

Hi,

What is the proper way to set-up the multiplicative constant vector for multiply_const_vcc?


I tried the code below and although it compiles, upon running the program I get the following error:

Segmentation fault (core dumped).


The code:

std::vector<gr_complex> k;
k[0]=0.1;

blocks::multiply_const_vcc::sptr multiply_const_0 = blocks::multiply_const_vcc::make(k);


I'll appreciate your help.

Thank you.

Best regards,
Khalid



Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
reply via email to

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