亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
12下一頁
最近訪問板塊 發(fā)新帖
查看: 4755 | 回復(fù): 19
打印 上一主題 下一主題

[C++] jsoncpp如何獲取大數(shù)(1億億) [復(fù)制鏈接]

論壇徽章:
5
戌狗
日期:2014-06-09 10:29:10酉雞
日期:2014-12-01 16:05:27處女座
日期:2015-01-07 18:35:262015亞冠之水原三星
日期:2015-06-03 09:26:222015亞冠之布里斯班獅吼
日期:2015-06-15 10:53:54
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2015-11-10 20:56 |只看該作者 |倒序瀏覽
之前用jsoncpp解釋json串,主要用asInt(),asString()兩個函數(shù)來獲取數(shù)據(jù),可是今天遇到一個1億億的數(shù),無法獲取,請問如何處理?
報錯:Real out of unsigned integer range

難道改用其他庫?

論壇徽章:
36
子鼠
日期:2013-08-28 22:23:29黃金圣斗士
日期:2015-12-01 11:37:51程序設(shè)計版塊每日發(fā)帖之星
日期:2015-12-14 06:20:00CU十四周年紀(jì)念徽章
日期:2015-12-22 16:50:40IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-01-25 06:20:0015-16賽季CBA聯(lián)賽之深圳
日期:2016-01-27 10:31:172016猴年福章徽章
日期:2016-02-18 15:30:3415-16賽季CBA聯(lián)賽之福建
日期:2016-04-07 11:25:2215-16賽季CBA聯(lián)賽之青島
日期:2016-04-29 18:02:5915-16賽季CBA聯(lián)賽之北控
日期:2016-06-20 17:38:50技術(shù)圖書徽章
日期:2016-07-19 13:54:03程序設(shè)計版塊每日發(fā)帖之星
日期:2016-08-21 06:20:00
2 [報告]
發(fā)表于 2015-11-10 21:05 |只看該作者
數(shù)據(jù)來源方寫成字符串,得到字符串,用大數(shù)庫

論壇徽章:
89
水瓶座
日期:2014-04-01 08:53:31天蝎座
日期:2014-04-01 08:53:53天秤座
日期:2014-04-01 08:54:02射手座
日期:2014-04-01 08:54:15子鼠
日期:2014-04-01 08:55:35辰龍
日期:2014-04-01 08:56:36未羊
日期:2014-04-01 08:56:27戌狗
日期:2014-04-01 08:56:13亥豬
日期:2014-04-01 08:56:02亥豬
日期:2014-04-08 08:38:58程序設(shè)計版塊每日發(fā)帖之星
日期:2016-01-05 06:20:00程序設(shè)計版塊每日發(fā)帖之星
日期:2016-01-07 06:20:00
3 [報告]
發(fā)表于 2015-11-11 08:49 |只看該作者
這就算大了,不會吧。

論壇徽章:
5
戌狗
日期:2014-06-09 10:29:10酉雞
日期:2014-12-01 16:05:27處女座
日期:2015-01-07 18:35:262015亞冠之水原三星
日期:2015-06-03 09:26:222015亞冠之布里斯班獅吼
日期:2015-06-15 10:53:54
4 [報告]
發(fā)表于 2015-11-11 09:38 |只看該作者
回復(fù) 2# cokeboL


    不是一個部門,這個有點難度。。。

論壇徽章:
5
戌狗
日期:2014-06-09 10:29:10酉雞
日期:2014-12-01 16:05:27處女座
日期:2015-01-07 18:35:262015亞冠之水原三星
日期:2015-06-03 09:26:222015亞冠之布里斯班獅吼
日期:2015-06-15 10:53:54
5 [報告]
發(fā)表于 2015-11-11 09:39 |只看該作者
fender0107401 發(fā)表于 2015-11-11 08:49
這就算大了,不會吧。


。。。。請問用jsoncpp怎么處理?

論壇徽章:
324
射手座
日期:2013-08-23 12:04:38射手座
日期:2013-08-23 16:18:12未羊
日期:2013-08-30 14:33:15水瓶座
日期:2013-09-02 16:44:31摩羯座
日期:2013-09-25 09:33:52雙子座
日期:2013-09-26 12:21:10金牛座
日期:2013-10-14 09:08:49申猴
日期:2013-10-16 13:09:43子鼠
日期:2013-10-17 23:23:19射手座
日期:2013-10-18 13:00:27金牛座
日期:2013-10-18 15:47:57午馬
日期:2013-10-18 21:43:38
6 [報告]
發(fā)表于 2015-11-11 09:48 |只看該作者
  Int asInt() const;
  UInt asUInt() const;
#if defined(JSON_HAS_INT64)
  Int64 asInt64() const;
  UInt64 asUInt64() const;
#endif // if defined(JSON_HAS_INT64)
  LargestInt asLargestInt() const;
  LargestUInt asLargestUInt() const;

論壇徽章:
36
子鼠
日期:2013-08-28 22:23:29黃金圣斗士
日期:2015-12-01 11:37:51程序設(shè)計版塊每日發(fā)帖之星
日期:2015-12-14 06:20:00CU十四周年紀(jì)念徽章
日期:2015-12-22 16:50:40IT運(yùn)維版塊每日發(fā)帖之星
日期:2016-01-25 06:20:0015-16賽季CBA聯(lián)賽之深圳
日期:2016-01-27 10:31:172016猴年福章徽章
日期:2016-02-18 15:30:3415-16賽季CBA聯(lián)賽之福建
日期:2016-04-07 11:25:2215-16賽季CBA聯(lián)賽之青島
日期:2016-04-29 18:02:5915-16賽季CBA聯(lián)賽之北控
日期:2016-06-20 17:38:50技術(shù)圖書徽章
日期:2016-07-19 13:54:03程序設(shè)計版塊每日發(fā)帖之星
日期:2016-08-21 06:20:00
7 [報告]
發(fā)表于 2015-11-11 10:04 |只看該作者
本帖最后由 cokeboL 于 2015-11-11 10:05 編輯

     

論壇徽章:
5
戌狗
日期:2014-06-09 10:29:10酉雞
日期:2014-12-01 16:05:27處女座
日期:2015-01-07 18:35:262015亞冠之水原三星
日期:2015-06-03 09:26:222015亞冠之布里斯班獅吼
日期:2015-06-15 10:53:54
8 [報告]
發(fā)表于 2015-11-11 13:19 |只看該作者
hellioncu 發(fā)表于 2015-11-11 09:48
Int asInt() const;
  UInt asUInt() const;
#if defined(JSON_HAS_INT64)


。。。你用的是哪個版本??
我的是jsoncpp-src-0.5.0,value.h文件中只有
      int compare( const Value &other );

      const char *asCString() const;
      std::string asString() const;
# ifdef JSON_USE_CPPTL
      CppTL::ConstString asConstString() const;
# endif
      Int asInt() const;
      UInt asUInt() const;
      double asDouble() const;
      bool asBool() const;

論壇徽章:
324
射手座
日期:2013-08-23 12:04:38射手座
日期:2013-08-23 16:18:12未羊
日期:2013-08-30 14:33:15水瓶座
日期:2013-09-02 16:44:31摩羯座
日期:2013-09-25 09:33:52雙子座
日期:2013-09-26 12:21:10金牛座
日期:2013-10-14 09:08:49申猴
日期:2013-10-16 13:09:43子鼠
日期:2013-10-17 23:23:19射手座
日期:2013-10-18 13:00:27金牛座
日期:2013-10-18 15:47:57午馬
日期:2013-10-18 21:43:38
9 [報告]
發(fā)表于 2015-11-11 13:22 |只看該作者
kaede_1 發(fā)表于 2015-11-11 13:19
。。。你用的是哪個版本??
我的是jsoncpp-src-0.5.0,value.h文件中只有
      int compare( const ...


剛下的,看樣子是新增加的特性

  New in JsonCpp 0.6.0:
  ---------------------

* Compilation

  - LD_LIBRARY_PATH and LIBRARY_PATH environment variables are now
    propagated to the build environment as this is required for some
    compiler installation.

  - Added support for Microsoft Visual Studio 2008 (bug #2930462):
    The platform "msvc90" has been added.

    Notes: you need to setup the environment by running vcvars32.bat
    (e.g. MSVC 2008 command prompt in start menu) before running scons.
   
  - Added support for amalgamated source and header generation (a la sqlite).
    Refer to README.md section "Generating amalgamated source and header"
    for detail.
   
* Value

  - Removed experimental ValueAllocator, it caused static
    initialization/destruction order issues (bug #2934500).
    The DefaultValueAllocator has been inlined in code.
   
  - Added support for 64 bits integer:
  
    Types Json::Int64 and Json::UInt64 have been added. They are aliased
        to 64 bits integers on system that support them (based on __int64 on
        Microsoft Visual Studio platform, and long long on other platforms).
       
        Types Json::LargestInt and Json::LargestUInt have been added. They are
        aliased to the largest integer type supported:
        either Json::Int/Json::UInt or Json::Int64/Json::UInt64 respectively.
       
        Json::Value::asInt() and Json::Value::asUInt() still returns plain
        "int" based types, but asserts if an attempt is made to retrieve
        a 64 bits value that can not represented as the return type.
       
        Json::Value::asInt64() and Json::Value::asUInt64() have been added
        to obtain the 64 bits integer value.
       
        Json::Value::asLargestInt() and Json::Value::asLargestUInt() returns
        the integer as a LargestInt/LargestUInt respectively. Those functions
        functions are typically used when implementing writer.
       
        The reader attempts to read number as 64 bits integer, and fall back
        to reading a double if the number is not in the range of 64 bits
        integer.
   
    Warning: Json::Value::asInt() and Json::Value::asUInt() now returns
    long long. This changes break code that was passing the return value
    to *printf() function.
  
    Support for 64 bits integer can be disabled by defining the macro
        JSON_NO_INT64 (uncomment it in json/config.h for example), though
        it should have no impact on existing usage.
   

論壇徽章:
5
戌狗
日期:2014-06-09 10:29:10酉雞
日期:2014-12-01 16:05:27處女座
日期:2015-01-07 18:35:262015亞冠之水原三星
日期:2015-06-03 09:26:222015亞冠之布里斯班獅吼
日期:2015-06-15 10:53:54
10 [報告]
發(fā)表于 2015-11-11 14:14 |只看該作者
果然,多謝

之前一時沒有方法,直接字符串匹配了
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP