c# - variable was wrong in debug mode using .netframework 3.5 -
i have problem code when step debug (vs2017 .net framework 3.5 ,debug mode) here code
class program { static void main(string[] args) { dataparameter para = new dataparameter("12"); } } enum testenum { a, b, c } class dataparameter { private bool c33; public dataparameter(string name) { testenum ta = testenum.a; c33 = ta == testenum.a || ta == testenum.b;//after execute :c33 = false name = name;//after execute :c33 = true } public string name { get; set; } }
when add breakpoint stops before executing code. when stops on line 24, assignment c33 has not been done , c33 has default value of bool member, false. after executing line 24 set true expected.
Comments
Post a Comment