Careful with sscanf and fscanf

If you are not careful while using sscanf and fscanf, you code could lead to stack corruption errors leading to application crash. Recently when migrating a project in VC6 to VC8, a similar situation arose, I was getting stack corruption errors… “Run-Time Check Failure #2 – Stack around the variable ‘ByteVar’ was corrupted.” So I […]
Continue reading…

 

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…