zoukankan
html css js c++ java
反转字符串
1.
#include<stdio.h>
#include<stdlib.h>
char *reverse(const char *p);
int main()
{
char *test="anihC evoL I";
char *p=reverse(test);
printf("%s",p);
free(p);
return 0;
}
char *reverse(const char *p)
{
char *dest=NULL; //空指针
int len=0,i;
char *d=""; //d 指向一块合法的地址
while(*p!='\0')
{
len++;
p++;
}
dest =(char *)malloc((len+1)*sizeof(char));
d=dest;
for(i=0;i<len;i++)
{
p--;
*d=*p;
d++;
}
return dest;
}
查看全文
相关阅读:
【LeetCode】241. Different Ways to Add Parentheses
【LeetCode】240. Search a 2D Matrix II
【LeetCode】239. Sliding Window Maximum
【LeetCode】238. Product of Array Except Self
【LeetCode】237. Delete Node in a Linked List
【Babble】批量学习与增量学习、稳定性与可塑性矛盾的乱想
【LeetCode】233. Number of Digit One
【LeetCode】236. Lowest Common Ancestor of a Binary Tree
MySQL存储过程
mysql远程连接/访问速度慢的解决方案
原文地址:https://www.cnblogs.com/zhou2011/p/2227050.html
最新文章
Swift入门篇-Hello World
Swift入门篇-swift简介
ios入门篇 -hello Word(1)
FDMB 增删改删 查 分页 封装
ios中输入框的父类--文本框,DataPick,pickerview
ASIHttpRequest请求HTTPS
FMDB
SDK和API区别
The specified type member 'Date' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties
在C#中实现Json的序列化与反序列化
热门文章
C# 利用 DbUp 通过多个SQL Script文件完成对数据库的更新
在IIS8.5的环境下配置WCF的Restful Service
通过配置web.config使WCF向外提供HTTPS的Restful Service
利用WCF创建简单的RESTFul Service
在ionic这个框架下(Angular JS),对URL进行重写,过滤掉URL中的#号
在Jenkins中获取GitHub对应Repository的Resource Code
通过VS创建简单的WCF服务
在Salesforce中向外公布Service去创建Lead,并且用Asp.Net去调用此Service
【LeetCode】263. Ugly Number
【LeetCode】242. Valid Anagram (2 solutions)
Copyright © 2011-2022 走看看