crash - c++ non-comprehensible crashing behaviour -


so created dll today , it's crashing no reason...

this works:

testa++; testb++;  const char *t = "test";  if (t == "adoinfosidnoxucnviune") { } 

this crashes @ testb++:

testa++;  const char *t = "test";  if (t == "adoinfosidnoxucnviune") {     testb++; } 

where testa , testb integers.. t isnt string it's compared with, don't it

you comparing pointers, not values pointers point to.

either use strcmp or use std::string.

the crash has occur elsewhere.

because pointing 2 different objects, code in either "if" statement not executed because values in pointers different.

somewhere in code, testing value of testb. in first example, testb incremented. in second example, testb not incremented.

have initialized testb?

seriously, when single stepped debugger, last line executed before crash?


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -