简体   繁体   中英

Strange values when debugging

When I was doing some debugging I noticed there were some strange values being stored, have a look at the "convX" variable here which should get the value of about 9.95 but turns out as 6.95*10^-310: http://gyazo.com/5109fc563e1e87939adea84ea87f3d88 Are variables not initialized to zero? Is that the problem?

The values seem to be fine (a couple of rows down) when doing the function call though, but are those values the ones fed as arguments into the function?: http://gyazo.com/b26b4bedbcc0557cd53ade5fe59827f8

Local variables of primitive data type are not initialized by default in C++. Strange values that you see are called as Garbage Values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM