My app is C++ based (no .net) and I need to know where on earth my app is started. This is in order to access a website (e.g. www.xyz.cn/info for china; www.xyz.com/info for the rest) with the correct region.
I've tried with ILocation Com interface but it tells me that there are 'no devices detected'.
Below code does some memory corruption due to which access violation happens at sub subsequent steps
If I remove this block of code every thing is working fine. Unable to figure out the issue in the below code. Please help
You are unlikely to get a valid answer doing it like that. You should use something like sprintf to convert the double value to a string and set the actual number of decimal places that you want in the format string.
As per what David has explained all doubles are actually stored subtly different to what you think because they round. I just want to extend why they round.
They round because the computer works in base 2 (0 and 1's) and you are working in decimal base 10 (0,1,2,..9)
10 does not work as a power of 2 you can go either side 2x2x2=8 OR 2x2x2x2=16 so any base 10 decimal fraction when written in base 2 will likely round