C操作内存函数(memset,memcpy,memcmp)
2016-01-28 14:45
357 查看
/* file name : memory_func_test.c author : zhongjun description :memory_func_test demo data :20150701 time :PM 22:57 key(study) :memory operate */ #include <stdio.h> #include <stdlib.h> char dst_string[20] = "dst string"; char src_string[10] = "src string"; int main() { int cmp_res; //set the store dst_string memory to 0 memset(dst_string,0,sizeof(dst_string)); memcpy(dst_string,src_string,sizeof(src_string)); printf("dst_string(%s)\n",dst_string); cmp_res = memcmp(dst_string,src_string,strlen(src_string)); return 0; }
相关文章推荐
- 使用UISearchController 实现搜索框
- jQuery的deferred对象详解
- Linux学习之CentOS(二十)--CentOS6.4下修改MySQL编码方法
- 多列布局
- position:sticky 定位 position:fixed
- 个性签名
- c#版在pc端发起微信扫码支付
- View绘制流程简述
- HDU 1286 找新朋友 (欧拉函数_打表)
- 循环生成学号/
- EventBus详细解析
- IDA动态调试Android的DEX文件
- js对象或json对象深拷贝
- 通用的contain函数
- webpack 发布配置
- 使用nodejs,express,mysql,Bootstrap开发采购招标网站(三)Bootstrap-table实现Ajax删除数据
- js对象转json字符串,并保留js对象中的javascript脚本
- 测试必备技能系列1 :通过mysql命令进行脚本数据导入
- Linux命令—echo
- SQL Server Cast and Convert