在线等待,怎样把长整型数组转换成字符串的数据转换为字符串型

1168人阅读
MFC、VC++(50)
C、C++(6)
一个长度比较长的字符串数据转换为double型数据,
自己写的,比较简单,如下:
(Windows XP, VC6调试通过)
#include "math.h"
CString str = "";int i=0, j=0;double bb=0;for(i=str.GetLength(), j=0; i&0; i--, j++){&&bb = bb + atoi(str.Mid(i-1, 1)) * pow(10, j);&}
CString sT
sTemp.Format("%f", bb);AfxMessageBox(sTemp);
仅供参考,欢迎大家提意见!
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:98451次
积分:1277
积分:1277
排名:千里之外
原创:21篇
转载:38篇
评论:15条
(1)(1)(1)(3)(1)(3)(1)(1)(2)(1)(4)(2)(1)(4)(1)(2)(1)(3)(7)(21)温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(12658)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'【Java】字符串数字转换为整型、长整型、浮点型',
blogAbstract:'要将字符串类型的数字转换整型、长整型、浮点型,可以使用下面的方法:\n\nInteger.parseInt(String s)\nLong.parseLong(String s)\nFloat.parseFloat(String s)\nDouble.parseDouble(String s)\n .csharpcode, .csharpcode pre { font-size: color: font-family: consolas, \"courier new\", courier, background-color: # } .csharpcode pre',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:8,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}

我要回帖

更多关于 将字符串转换成整型 的文章

 

随机推荐