当前位置:网站首页>C language to realize string reverse order arrangement
C language to realize string reverse order arrangement
2022-07-28 22:38:00 【Passing bears~】
Reverse string order
c Language implementation string reverse order arrangement
Code example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void nixu(char *dst, char *src, int len)
{
char *dest = NULL;
char *s = NULL;
char *d = NULL;
d = dst;
s=src+sizeof(char)*len-sizeof(char);
while(len--!= 0)
{
*d++=*s--;
}
*d=0;
}
int main(void)
{
char dts[20] = {
0};
char src[] = "123456789";
nixu(dts, src, strlen(src));
printf(dts);
return 0;
}
effect

边栏推荐
- 79. Word search (medium string array matrix backtracking)
- SSH password free login
- ATT&CK初步了解
- 微信小程序使用canvas绘图,圆形头像,网络背景图,文字,虚线,直线
- 职场pua但有道理
- Use webworker to perform background tasks
- fatal error: io. h: No such file or directory
- Changes in the history of oscilloscope development
- [Ruiji takeout project] Day5 - Chapter 6 mobile verification code login
- Static details of static members
猜你喜欢

Mysql内置函数

Qt+FFmpeg环境搭建

Sword finger offer II 052. flatten binary search tree (simple binary search tree DFS)

MySQL built-in functions

Solve Jupiter: the term 'Jupiter' is not recognized as the name of a cmdlet, function, script file

The function of wechat applet to cut pictures

Idea generate class diagram plug-in UML (super detailed)

STM32 board level support package for keys

使用PCL批量将点云.bin文件转.pcd

Win11 how to open software notification
随机推荐
When can I sign up for the 2022 class I constructor examination?
2022年一级建造师考试什么时候才能报名?
Remember the first line segment tree (corresponding to Luogu 3372)
Closure, prototype and original link
ssh免密登陆
Detection and tracking evaluation index
Static route and default route experiment
php二维数组如何删除去除第一行元素
Solve Jupiter: the term 'Jupiter' is not recognized as the name of a cmdlet, function, script file
internet的基本服务中文件传输命令是哪个
JMeter installs third-party plug-ins plugins Manager
Ruiji takeout - background login function development
redis相关
6K6w5LiA5qyh5pS75Ye75YiG5p6Q
What are the main functions and uses of LCR tester
ngx+sql环境离线安装日志(rpm安装)
PaddleNLP基于ERNIR3.0文本分类以中医疗搜索检索词意图分类(KUAKE-QIC)为例【多分类(单标签)】
[CS231N]Lecture_ 2:Image Classification pipelin
ES6, deep copy, shallow copy
MOV格式是不是静态图像文件格式