当前位置:网站首页>c语言实现字符串逆序排列
c语言实现字符串逆序排列
2022-07-28 20:50:00 【路过的小熊~】
字符串逆序
c语言实现字符串逆序排列
代码示例
#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;
}
效果

边栏推荐
- CMD common commands
- vuejs中如何实现动态路由切换及路由的缓存
- 6K6w5LiA5qyh5pS75Ye75YiG5p6Q
- [Ruiji takeout project]day4 - dish management
- Chrome encountered a problem when debugging the code. After modifying and saving the code in vscode, chrome did not update after refreshing
- Winserver operation and maintenance technology stack
- mysql8.0无法给用户授权或提示You are not allowed to create a user with GRANT的问题
- Container configuration starts redis cluster single machine 6 nodes 3 Master 3 slave
- Necessary for in-depth learning: split the data set, split the labels according to the split pictures, and check the interval of all marked labels
- Wechat applet uses canvas drawing, round avatar, network background, text, dotted line, straight line
猜你喜欢

Win11 how to open software notification

Paddlenlp text classification based on ernir3.0: take wos dataset as an example (hierarchical classification)

微信小程序剪切图片的功能

MySQL built-in functions

HCIP(12)
![[CVPR 2021] cylinder3d: cylindrical asymmetric 3D convolution network for LIDAR point cloud segmentation](/img/3d/3def78ec88419712e14cf437e21447.png)
[CVPR 2021] cylinder3d: cylindrical asymmetric 3D convolution network for LIDAR point cloud segmentation

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

Sword finger offer II 054. Sum of all values greater than or equal to nodes (medium binary search tree DFS)

LCR测试仪最为主要的功能和用途都是什么

Less than a year after its establishment! MIT derivative quantum computing company completed financing of US $9million
随机推荐
32. Longest valid bracket (difficult stack string)
Image is referred in multiple repositories
mysql create语句能不能用来建立表结构并追加新的记录
MOV格式是不是静态图像文件格式
Wechat applet uses canvas drawing, round avatar, network background, text, dotted line, straight line
纪念一下第一次写的线段树了喽(对应洛谷3372)
Idea generate class diagram plug-in UML (super detailed)
Paddlenlp is based on ernir3.0 text classification. Take the crime prediction task of cail2018-small dataset as an example [multiple tags]
Openresty request authentication
Sword finger offer II 058. schedule (medium design segment tree treemap ordered set)
Lvs+keepalived high availability deployment practical application
75. Color classification (medium array double pointer sorting)
Hcip experiment (14)
2022年一级建造师考试什么时候才能报名?
How to install WiFi correctly
Att & CK Threat Intelligence
Day3 classification management of Ruiji takeout project
Excel-vba quick start (XIII. Common usage of date)
Sword finger offer II 052. flatten binary search tree (simple binary search tree DFS)
internet的基本服务中文件传输命令是哪个