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
Post a Comment