Pregunta

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

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top