首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

DELPHI中的数据类型转换的有关问题

2012-03-06 
DELPHI中的数据类型转换的问题刚接触delphi,有个问题不懂itemp:int64itemp:strtoint(leftstr(str,9))*21

DELPHI中的数据类型转换的问题
刚接触delphi,有个问题不懂
itemp:int64;
itemp:=strtoint(leftstr(str,9))*21+6787774521;

str是 '134327626222 ',结构itemp是5313687371.为什么呢?


[解决办法]
应该用strtoint64
而不是strtoint
不然的话,int最多能表示到2147483647,超过就溢出了,当然就成了负数

热点排行