自己动手实现字符串倒叙
2013-07-23 16:09
363 查看
#include <stdio.h> //将字符串s倒叙 void strrev(char *s) { char *p=s,t; if(*p) while(p[1]) p++; while(s<p) { t=*s; *s++=*p; *p--=t; } } void main () { char s[]="abcdef"; strrev(s); puts(s); }
相关文章推荐
- 自己动手实现OpenGL!
- 实现自己的字符串拷贝函数Strcpy
- 自己动手实现简单的Vector
- 自己动手,实现jQuery中的ImageCopper.
- 开发性能测试工具——自己动手实现迭代功能
- <仅是自己做笔记。。。系列15>实现一个挺高级的字符匹配算法: 给一串很长字符串,要求找到符合要求的字符串,例如目的串:123 1******3***2 ,12*****3这些都要找出来
- 自己动手实现MyCreateRemoteThread
- 自己动手实现图的BFS和DFS(附完整源码)转
- 自己动手系列——实现一个简单的LinkedLis
- 自己实现php UTF8中文字符串截取
- 自己动手实现Crash时候Dump.
- 自己动手实现集合框架类(四)之LinkedHashMap
- 自己动手实现jQuery Callbacks完整功能代码详解
- Java高并发程序-Chapter3 JDK并发包(第十四讲)同步控制之自己动手实现 CoutDownLatch
- 自己动手实现一个《倒水解密》游戏
- 自己动手开发网络服务器(三):实现多线程
- 自己动手写CPU之第九阶段(9)——修改OpenMIPS以实现ll、sc指令
- .NET实现之(自己动手写高内聚插件系统)
- 自己动手实现HashMap
- 自己动手重新实现LINQ to Objects: 2 - Where