Variable value is always’s zero, no matter what you do!

Recently a friend of mine (sitting just behind me) had a strange problem. I wrote an inline function which was like… void SetBlah( const bool IsBlah ) { m_IsBlah = IsBlah; } Now he was using this function since we work for the same project! So he had a value 1 for IsBlah when calling […]
Continue reading…

 

Allocating memory on stack.

We’ve done memory allocation on heap, but ever thought of doing this on stack! Well why do we need to allocate memory on stack if we have sufficient heap space left with us. A function called _alloca is provided just for this purpose. Reasons why I use _alloca is, because the memory allocated is small […]
Continue reading…