拼接JSON字符串
来源:互联网 发布:python 游戏编程 pdf 编辑:程序博客网 时间:2024/05/16 12:26
传输数据时经常要用到JSON格式,拼接JSON字符串是常用的事,这里记录一下,直接看代码吧。
[mapan@localhost unixNetwork]$ cat test.cpp #include<stdio.h> #include<string.h> void func(char test1[],char test2[],char test3[]){ char test[100]; sprintf(test,"{\r\n meida_code:\"%s\",\\r\n app_id:\"%s\",\\r\n user_id:\"%s\",\\r\n}",test1,test2,test3); printf("%s\n",test);}int main() { char str1[]="1"; char str2[]="2"; char str3[]="3"; func(str1,str2,str3); return 0; }[mapan@localhost unixNetwork]$ g++ test.cpp [mapan@localhost unixNetwork]$ ./a.out { meida_code:"1", app_id:"2", user_id:"3",}[mapan@localhost unixNetwork]$
阅读全文
0 0
- 拼接JSON字符串对象
- 拼接json字符串
- concat拼接json字符串
- JSON拼接字符串
- js拼接json字符串
- Json字符串拼接
- json字符串拼接
- 拼接JSON字符串
- 拼接json字符串
- 手动字符串拼接成JSON
- java中拼接Json字符串
- 字符串截取拼接,split,json操作,html拼接
- jquery拼接ajax 的json和字符串拼接
- Ext动态加载树,拼接Json字符串
- Json拼接字符串必须用双引号
- Jquery Ajax返回Json字符串 拼接table
- java 拼接复杂的json字符串
- Java中拼接json格式字符串
- python—matplotlib数据可视化实例注解系列-----之横条图
- 二叉排序树建立(JAVA实现)
- CentOS7.3 安装及配置Apache 和Tomcat
- RabbitMQ教程之php-amqplib(六)主题
- 一张小图看懂hibernate
- 拼接JSON字符串
- 部件和布局
- TabLayout的简单使用
- 最长回文(Manacher算法)
- iOS- 报错(崩)[< > setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
- Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'
- 1021. Deepest Root (25)
- HDU 6168
- 安卓开发四大组件