linux学习之c语言swap函数
2016-03-05 12:23
609 查看
函数名: swab
功 能: 交换字节
用 法: void swab (char *from, char *to, int nbytes);
程序例:
#include
<stdlib.h>
#include <stdio.h>
#include <string.h>
char source[15] = "rFna koBlrna d";
char target[15];
int main(void)
{
swab(source,
target, strlen(source));
printf("This is target: %sn", target);
return 0;
}
结果:
This
is target:Frank Borland
功 能: 交换字节
用 法: void swab (char *from, char *to, int nbytes);
程序例:
#include
<stdlib.h>
#include <stdio.h>
#include <string.h>
char source[15] = "rFna koBlrna d";
char target[15];
int main(void)
{
swab(source,
target, strlen(source));
printf("This is target: %sn", target);
return 0;
}
结果:
This
is target:Frank Borland
相关文章推荐
- 查看linux下mysql版本
- 解决Linux 下 root用户删除文件提示:Operation not permitted
- 常用的linux命令
- Redhat Linux上mysql安装-binary package安装
- centos配置虚拟主机多网站
- 学习linux决心书
- Linux系统中tr命令的基本使用教程
- Linux内核分析第二周总结
- Redhat Linux上mysql安装-RPM安装
- Linux内核分析2:一个简单的时间片轮转多道程序内核代码分析
- linux系统性能调优之vmstat
- linux 常用命令
- linux 系统性能之uptime
- Linux防火墙之ipfilter(iptalbes)介绍使用
- 学习linux决心书
- linux expect 简介与使用
- CentOs6.7 python2.6升级到2.7.11
- linux下umask详解
- ARM-Linux移植之(四)——根文件系统构建
- Linux文件目录及其作用