So here is what I asking:

lea eax, [esp]
push    104h        ; Count
push    offset a__2 ; ".\\"
push    eax     ; Dest
call    _strncpy
add esp, 0Ch

Can you please explain me this asm code snippet. The eax register late is assigned as an character pointer to an global variable. My reall question is how allocated memory on stack that doesn't poped at the end of the functions is written on c++ language.

Can you please explain me this asm code snippet.

It looks straightforward to me. Arguments are pushed onto the stack, _strncpy() is called, and the stack is adjusted to "remove" the arguments. Which parts are confusing you?

My reall question is how allocated memory on stack that doesn't poped at the end of the functions is written on c++ language.

In C++ all memory pushed onto the stack in or by the function will be popped. Attempts to use a pointer to any local variables or parameters after the function returns invokes undefined behavior because you're referencing memory that's highly likely to be reused almost immediately for other things.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.