So after going through all the code, i notice i dont need an extra variable to save target temp into. It seems reprap object has its on gettargettemp/getactivetemp within itself. After implementing just one line of code like this:
targettemp = reprap.GetHeat().GetTargetTemperature(i); // i is the heaternumber
I was able to read the active and standby temperatures just fine. I'm writing here this so that if anyone needs help regarding the issue can see it.
Thank you all for reading!