Json

和proto与xml类似,json也是一种数据交换格式,它简洁易用,所以受到大家的推崇,在游戏服务器中也有所应用,比如说idip,邮件等。基本用法为,先把数据保存在Json中,然后再在使用的一方读取出来,例如:

//保存侧

Json::Value root;

root["1"] = 1;

root["2"] = 2;

string str = root.toStyledString();

 

//使用侧

Json::Value root;

Json::Reader reader;

if (reader.parse(str, root))//上面提到的str

{

    int value1 = root["1"].asInt();

    int value2 = root["2"].asInt();

}

 

 

Json的安装:

https://www.jianshu.com/p/b4cedc429842

https://www.cnblogs.com/yuanzhifei/p/9513277.html

 

Json安装遇到的问题:

https://blog.csdn.net/doc_sgl/article/details/8770234/

http://www.downyi.com/downinfo/174278.html

https://blog.csdn.net/weixin_41147129/article/details/89605465

https://blog.csdn.net/flyyufenfei/article/details/72780026

https://blog.csdn.net/xianhua7877/article/details/80815253

https://blog.csdn.net/byxdaz/article/details/80392917

 

 

Json的使用

https://blog.csdn.net/admin_maxin/article/details/53175779?utm_source=copy

https://blog.csdn.net/OO_SEN/article/details/98480848

https://blog.csdn.net/Wu_Yimin/article/details/92838748

https://www.cnblogs.com/lidabo/p/9436217.html

https://blog.csdn.net/LL596214569/article/details/85221694

https://www.cnblogs.com/ZY-Dream/p/10054074.html

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值