Re: [Cppcms-users] memory
Brought to you by:
artyom-beilis
|
From: mawan s. <ma...@gm...> - 2015-11-13 08:43:04
|
Thankyou Marcel
I was curious on looping statement increasing the memory. But, with you
explanation, it is clearly now.
Thanks for enlightenment.
Regards.
On Fri, Nov 13, 2015 at 3:03 PM, Marcel Hellwig <ke...@co...> wrote:
> On 13.11.2015 04:18, mawan sugiyanto wrote:
> > void users::loadimage(std::string sid){
> > int width, height;
> stack, stack
> > Image image("../profile_images/default.png");
> stack
> > Geometry gtx(200,200);
> stack
> > Blob b;
> stack
>
> Everything is allocated on the stack, as long as you don't allocate it
> via new (or {c,a}malloc)
> > is image variable allocated on stack or in new memory?
> it is called heap, not new memory.
> > and i can not delete image variable like unset variable?
> All your variables will be deleted, when the programm flow "reaches"
> that last } .
> Your only way to force to unset a variable is to begin a new scope
>
> > void foo() {
> > int f;
> > {
> > int g = 3;
> > f = g;
> > }
> > return f;
> > }
>
> g is only valid in the scope it was declared in. You cannot reach it,
> outside of the scope.
>
> Greetings
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
|