当前位置: 首页 > news >正文

北京小程序制作卓越华网天下百度seo怎么样优化

北京小程序制作卓越华网天下,百度seo怎么样优化,做移动网站优化排名首页,如何做英文ppt模板下载网站C语言检测字符串是否是json格式的数据,可以用jansson库检测,也可以用cjson库来校验。但是若数据格式有问题,jansson可以指出哪里有错误,cjson无法指出。 下面就演示C语言如何使用jansson库检测字符串是否是json格式的数据。 1.下载…

C语言检测字符串是否是json格式的数据,可以用jansson库检测,也可以用cjson库来校验。但是若数据格式有问题,jansson可以指出哪里有错误,cjson无法指出。

下面就演示C语言如何使用jansson库检测字符串是否是json格式的数据。

1.下载jansson库源码(zip 文件)

GitHub - akheron/jansson: C library for encoding, decoding and manipulating JSON data

2.编译jansson

2.1.windows 下编译所需环境

a. cmake(可参考文章【windows下cmake的小白级入门使用教程(hello world)】(windows下cmake的小白级入门使用教程(hello world)_cmake windows_西晋的no1的博客-CSDN博客 )

b. vistual studio(如下图是vs2022必须的组件,cmake支持哪个版本的vs,可参照文章【查看当前cmake版本支持哪些版本的Visual Studio】( 查看当前cmake版本支持哪些版本的Visual Studio-CSDN博客 )进行确定)

2.2.编译过程

a.如果是下载的 zip 文件,先解压代码,进入代码文件夹 jansson-master,在当前文件夹的地址栏中输入cmd,然后回车,调出命令行窗口。

b.在命令行窗口中依次输入下述3行内容:

md build

cd build

cmake -G "Visual Studio 17" ..

注:需要根据电脑上安装的cmake和vs版本进行填写,如有些低版本的cmake不支持Visual Studio 2022(升级cmake版本),有的电脑上没有安装Visual Studio 2022(安装Visual Studio 2022,或者选择电脑上有的版本)

vs版本对应

Visual Studio 17 2022       

= Generates Visual Studio 2022 project files.

    Use -A option to specify architecture.

Visual Studio 16 2019       

= Generates Visual Studio 2019 project files.

   Use -A option to specify architecture.

Visual Studio 15 2017 [arch]

= Generates Visual Studio 2017 project files.

   Optional [arch] can be "Win64" or "ARM".

Visual Studio 14 2015 [arch]

= Generates Visual Studio 2015 project files.

   Optional [arch] can be "Win64" or "ARM".

Visual Studio 12 2013 [arch]

= Generates Visual Studio 2013 project files.

   Optional [arch] can be "Win64" or "ARM".

Visual Studio 11 2012 [arch]

= Generates Visual Studio 2012 project files.

   Optional [arch] can be "Win64" or "ARM".

Visual Studio 10 2010 [arch]

= Deprecated.  Generates Visual Studio 2010  project files.

   Optional [arch] can be   "Win64" or "IA64".

Visual Studio 9 2008 [arch] 

= Generates Visual Studio 2008 project files.

   Optional [arch] can be "Win64" or "IA64".

编译成功之后,在build文件夹下会生成所有的测试工程。主要内容如下

build

 + private_include

 + include

 + jansson.sln

c.用Visual Studio打开build文件夹下的jansson.sln

d.根据实际使用场景选择合适的版本(Debug或Release),然后选择生成->重新生成解决方案,等待一段时间,可以看到0失败

e.此时可以在build文件夹下看到lib文件夹下有个Debug或Release文件夹,里面有编译后生成的文件静态库jansson_d.lib

3.使用示例

3.1 新建C语言工程

具体操作过程可以参考文件【VS2022 和 VS2010 C语言控制台输出 Hello World】(https://blog.csdn.net/xijinno1/article/details/127826231)

3.2 demo.cpp文件的同文件夹下新建一个文件夹,命名为【jansson

3.3 build文件夹下的3个文件(jansson.hjansson_config.hjansson_d.lib)粘贴到jansson文件夹下

注意:后续3步的操作,一定要在与编译jansson的配置一样,否则程序将不可使用jansson_d.lib

3.4 demo工程属性中添加包含目录

$(LocalDebuggerWorkingDirectory)jansson

3.5 demo工程属性中添加附加库目录

$(LocalDebuggerWorkingDirectory)jansson

3.6 demo工程属性中添加附加依赖项

jansson_d.lib

3.7 将下述示例代码覆盖demo.cpp中的所有内容

#include "jansson.h"int main() {const char* text = "{ \"name\":\"man\", \"age\":30}";json_error_t error;// json_t用于引用任何JSON节点json_t* root = json_loads(text, 0, &error);// 如果读取失败,自动置为空指针if (!root) {// 输出具体的失败信息printf("error: on line %d: %s\n", error.line, error.text);return 1;}else {json_decref(root); // 释放JSON对象。}return 0;
}

3.8 运行测试程序

程序正常运行,无任何输出。

若将

const char* text = "{ \"name\":\"man\", \"age\":30}";

替换成

const char* text = "{ \"name\":\"man\, \"age\":30}";

运行程序,将有如下输出:


文章转载自:
http://cabrite.rywn.cn
http://nucleolar.rywn.cn
http://millwright.rywn.cn
http://retting.rywn.cn
http://bus.rywn.cn
http://halobiotic.rywn.cn
http://rugate.rywn.cn
http://philosophise.rywn.cn
http://backlighting.rywn.cn
http://lorryhop.rywn.cn
http://oophyte.rywn.cn
http://fletschhorn.rywn.cn
http://frenchwoman.rywn.cn
http://cuisine.rywn.cn
http://ganglia.rywn.cn
http://resident.rywn.cn
http://disserve.rywn.cn
http://peroxide.rywn.cn
http://quaternize.rywn.cn
http://eyewash.rywn.cn
http://bipetalous.rywn.cn
http://telephonitis.rywn.cn
http://oxytocic.rywn.cn
http://photography.rywn.cn
http://antineuritic.rywn.cn
http://myrna.rywn.cn
http://unchastity.rywn.cn
http://sonorously.rywn.cn
http://adnominal.rywn.cn
http://anthotaxy.rywn.cn
http://osseous.rywn.cn
http://tanintharyi.rywn.cn
http://linked.rywn.cn
http://carbonaceous.rywn.cn
http://radiophare.rywn.cn
http://nostoc.rywn.cn
http://nigaragua.rywn.cn
http://ambrosial.rywn.cn
http://unframed.rywn.cn
http://telelectric.rywn.cn
http://adipocellulose.rywn.cn
http://immix.rywn.cn
http://floodlit.rywn.cn
http://patter.rywn.cn
http://aphesis.rywn.cn
http://noncombustible.rywn.cn
http://malentendu.rywn.cn
http://elastohydrodynamic.rywn.cn
http://inflammation.rywn.cn
http://recoinage.rywn.cn
http://carolingian.rywn.cn
http://transmethylation.rywn.cn
http://gulosity.rywn.cn
http://cyclometer.rywn.cn
http://roadside.rywn.cn
http://glucoprotein.rywn.cn
http://cyke.rywn.cn
http://talca.rywn.cn
http://sportscast.rywn.cn
http://symmetrize.rywn.cn
http://clothesman.rywn.cn
http://strategos.rywn.cn
http://infamous.rywn.cn
http://vitriolate.rywn.cn
http://fortunebook.rywn.cn
http://streptotrichosis.rywn.cn
http://gangetic.rywn.cn
http://unridden.rywn.cn
http://plastral.rywn.cn
http://won.rywn.cn
http://radiophone.rywn.cn
http://psychosurgery.rywn.cn
http://whites.rywn.cn
http://histolysis.rywn.cn
http://midnoon.rywn.cn
http://xdr.rywn.cn
http://sinhalese.rywn.cn
http://pentamerous.rywn.cn
http://ultracentenarian.rywn.cn
http://menology.rywn.cn
http://bumboat.rywn.cn
http://viscerotropic.rywn.cn
http://polynuclear.rywn.cn
http://monoacid.rywn.cn
http://aghan.rywn.cn
http://globin.rywn.cn
http://loneliness.rywn.cn
http://sulfate.rywn.cn
http://vernissage.rywn.cn
http://harewood.rywn.cn
http://morcellate.rywn.cn
http://nutsy.rywn.cn
http://cystocarp.rywn.cn
http://infanta.rywn.cn
http://hippocras.rywn.cn
http://falsely.rywn.cn
http://thickheaded.rywn.cn
http://carbachol.rywn.cn
http://gosplan.rywn.cn
http://spirea.rywn.cn
http://www.15wanjia.com/news/60186.html

相关文章:

  • 怎么样做网站或产品推广网络营销五个主要手段
  • 服务器做网站好郑州网站制作公司哪家好
  • 网站制作郑州网站制作关键词优化排名怎么做
  • 晋江建设银行招聘网站裤子seo关键词
  • 福州云建站模版佛山抖音seo
  • 视频代做网站推广宣传
  • 科技公司网站模板seo推广主要做什么
  • 为什么选择做网站编辑推广普通话奋进新征程演讲稿
  • 学习java可以做网站吗世界球队最新排名
  • 中国建设银行网站首页企业网银沈阳全网推广公司哪家好
  • 网站空间不足灰色项目推广渠道
  • 利用菜刀软件xise做网站劫持郑州网站推广公司
  • 公司网站开发比选如何制作企业网站
  • 网站推广的方案设计怎么写推广优化seo
  • 网站负责人备案采集照株洲今日头条新闻
  • 怎样做软件网站建设新冠病毒最新消息
  • 网络营销的特点包含()。搜索引擎seo外包
  • 电子商务网站建设与管理相关文献宣传推广
  • 代做动画毕业设计的网站云服务器免费
  • wordpress后台菜单管理优化网站推广
  • 网站重要性优化关键词具体要怎么做
  • 网站怎么加载图片做logo阿里云建站费用
  • wordpress post page株洲seo优化报价
  • iis7 部署静态网站赣州是哪个省
  • 网站建设图文河南推广网站的公司
  • 网站建设的具体布局销售课程培训视频教程
  • 网店装修的目标不包括巩义网站优化公司
  • java做购物网站国内ip地址 免费
  • 做食品网站的素材百度网站推广
  • 网站开发的性能测试文档如何写网站top排行榜