Convert decimal (SQL) to double C++

2019-08-02 01:39发布

问题:

I have a SQL query which return records with only one column of type decimal (18,18).

In the C++ code I need to convert each value to double to add it to an array.

What's the best way of doing it?

Thank you

回答1:

I would suggest converting it to a Real before taking it from the database they are roughly the same datatype. http://msdn.microsoft.com/en-us/library/ms173773.aspx