将decimal(SQL)转换为double C ++ [英] Convert decimal (SQL) to double C++

查看:930
本文介绍了将decimal(SQL)转换为double C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SQL查询,它只返回一个类型为decimal的列(18,18)。



在C ++代码中,我需要将每个值转换为



谢谢

p>

解决方案

我建议将它转换为Real,然后从数据库中获取它们是大致相同的数据类型。 http://msdn.microsoft.com/en-us/library/ms173773.aspx


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

解决方案

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

这篇关于将decimal(SQL)转换为double C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆