Boost logo

Boost :

Subject: Re: [boost] using of circular_buffer
From: news.gmane.org (q3wolfi_at_[hidden])
Date: 2012-03-28 19:11:16


thank you! i'll consider to have a more look into the c++ language and
throwing my questions in comp.lang.c++
on the other hand i have to admit that i have confused serveral times
myself, which is, just another problem ^^

Am 3/28/2012 9:48 PM, schrieb Stewart, Robert:
> news.gmane.org wrote:
>>
>> when debugging, i got some errors. do i use the circurlar
>> buffer wrong?
>
> These posts are not on topic. You're hitting many basic C++ errors and this list is not the place to learn the language. Refer to http://www.boost.org/community/policy.html for details.
>
>> void ConsoleText::FormatOutput()
>> {
>> outPutText = "";
>> for (int i = 0; i< textBuffer->buffer.size(); i++)
>> {
>> outPutText += textBuffer->buffer.front();
>> outPutText += "\n";
>> }
>> }
>
> In this case, you're never advancing through textBuffer->buffer's elements but rather calling front() repeatedly. You need to call pop_front() to move to the next element. I have no idea what outPutText is, but it may be misbehaving when you make it too large.
>
>> on this call:
>> textBuffer->buffer.push_front(message);
>>
>> i'll get a segmantion fault, which is an indicator of that
>> textBuffer wasn't instantiated well.
>
> For that to segfault, I suspect your memory is trashed. Is textBuffer still a valid pointer in that case? Have you actually used a debugger?
>
> Please consider posting to comp.lang.c++.moderated or somewhere else to work on such problems.
>
>
> _____
> Rob Stewart robert.stewart_at_[hidden]
> Software Engineer using std::disclaimer;
> Dev Tools& Components
> Susquehanna International Group, LLP http://www.sig.com
>
>
> ________________________________
>
> IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of vi
> ruses.
>
> _______________________________________________
> Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk