当前位置:网站首页>C language output string in reverse order
C language output string in reverse order
2022-07-27 16:31:00 【andrewhxc】
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void Reverse(const char *str, char *ptr);
int main()
{
char str[100];
char ptr[100];
printf("Input a string:");
gets(str);
Reverse(str, ptr);
printf("Inversed results:%s\n", ptr);
}
void Reverse(const char* str, char* ptr)
{
int n = strlen(str);
int i;
for (i = 0; i <= n; i++) {
ptr[i] = str[n - i - 1];
}
ptr[i - 1] = '\0';
}
边栏推荐
- 知网、万方数据库免费下载论文------比连接学校内网速度快数倍不止(有的学校万方数据库不支持下载)
- excel skill
- Simulation生成报表
- 2021-06-02
- Notes on implementation and acquisition of flowable custom attributes
- __ The difference between typeof and typeof
- Find active SQL connections in SQL Server
- What is ti's calculation for successively canceling the agency rights of anfuli / Wenye / Shiping?
- OpenCV(一)——图像基础知识
- DRF learning notes (II): Data deserialization
猜你喜欢

MySQL high version report SQL_ mode=only_ full_ group_ By exception

Notes on implementation and acquisition of flowable custom attributes

第21回---第30回

Jupyter creates a virtual environment and installs pytorch (GPU)

Mysql5.7 master-slave hot standby settings on CentOS

Flowable process custom attribute

DEX and AMMS of DFI security

Yys mouse connector

【论文阅读】Single- and Cross-Modality Near Duplicate Image PairsDetection via Spatial Transformer Compar

Time series ARIMA model
随机推荐
Draw circuit diagram according to Verilog code
Yys mouse connector
Excel提取重复项
Axure 安装图标字体元件库
JWT简介
Const summary
HowNet and Wanfang database download papers for free ----- several times faster than connecting to the school intranet (some schools Wanfang database does not support downloading)
OpenCV(一)——图像基础知识
Leetcode 226 flip binary tree (recursive)
DRF learning notes (III): model class serializer modelserializer
Servlet basic knowledge points
DRF learning notes (II): Data deserialization
Pdf extract text
C language programming (Third Edition)
jupyter 创建虚拟环境并安装pytorch(gpu)
201403-1
第31回---第52回
Chuanyin holdings disclosed that it was prosecuted by Huawei: a case has been filed, involving an amount of 20million yuan
插入word中的图片保持高dpi方法
Coturn service installation in webrtc