Reverse String

Write a function that takes a string as input and returns the string reversed.

Example:
Given s = "hello", return "olleh".

 /*************************************************************************
> File Name: LeetCode344.c
> Author: Juntaran
> Mail: Jacinthmail@gmail.com
> Created Time: 2016年05月10日 星期二 02时25分37秒
************************************************************************/ /************************************************************************* Reverse String Write a function that takes a string as input and returns the string reversed. Example:
Given s = "hello", return "olleh". ************************************************************************/ #include "stdio.h" char* reverseString(char* s)
{
int i;
int length = strlen(s);
char temp; for( i=; i<length/; i++ )
{
temp = s[i];
s[i] = s[length-i-];
s[length-i-] = temp;
}
return s;
} int main()
{
char* s = "hello";
reverseString(s);
return ;
}

最新文章

  1. BPM配置故事之案例4-子表
  2. centos 7 install python spynner
  3. WIN32服务程序(二):卸载服务
  4. Linux内核分析——汇编代码执行及堆栈变化
  5. 网页特殊符号HTML代码大全
  6. SlickGrid example 5:带子项的展开收缩
  7. CodeForces 483B Friends and Presents
  8. Open vSwitch FAQ (二)
  9. 一起学习 微服务(MicroServices)-笔记
  10. python学习之subprocess模块
  11. UVA 10806 Dijkstra, Dijkstra.(费用流)
  12. java跨平台性分析
  13. 小米2s的座充,看看这个是什么芯片? - 电池&综合DIY(Flashlight Electronics-Batteries Include - 手电大家谈-手电筒爱好者之家
  14. SDN学习之OpenFlow协议分析
  15. S7-200和S7-300profibus-DP通信
  16. 【括号问题】$(&quot;li:lt(&quot; + (idx + 1) + &quot;)&quot;) 手风琴效果注意事项
  17. Java EE开发技术课程
  18. restful : 面向资源架构
  19. 动态产生DataSource------待整理
  20. spring cloud: Hystrix(一):简单使用

热门文章

  1. C++11 能好怎?
  2. homework-08-作业2
  3. jquery easyui的异步tree
  4. HDU1028Ignatius and the Princess III(母函数)
  5. poj 3635 Full Tank? ( bfs+dp思想 )
  6. react native 遇到的坑
  7. 用BenchmarkDotNet给C#程序做性能测试
  8. 在Mac OS X下让你的Terminal带上Color
  9. PL/pgSQL的RETURN QUERY例子
  10. Visio Premium 2010密钥+破解激活方法