当前位置:网站首页>Pointer -- output all characters in the string in reverse order
Pointer -- output all characters in the string in reverse order
2022-07-06 14:35:00 【|Light|】
requirement
Programming , Enter a string , Output all characters in reverse order .( Use a pointer to achieve )
Code
/* * This function implements string a Reverse operation of , If the original string is string, Reverse order followed by gnirts, * Please store the string after reverse order in a In what it points to */
void reverse(char *a)
{
int n = strlen(a);
int b[n],c = 0;
for(int i = n-1;i>=0;i--)
{
b[c] = a[i];
c++;
}
for(int i = 0;i<n;i++)
{
a[i] = b[i];
}
}
main function
int main()
{
char a[200];
gets(a);
reverse(a);
puts(a);
return 0;
}
test
Test input
I am a student
Output
tneduts a ma I
边栏推荐
- How to earn the first pot of gold in CSDN (we are all creators)
- Attack and defense world misc practice area (simplerar, base64stego, no matter how high your Kung Fu is, you are afraid of kitchen knives)
- c语言学习总结(上)(更新中)
- 【指针】求字符串的长度
- Statistics 8th Edition Jia Junping Chapter 5 probability and probability distribution
- Intranet information collection of Intranet penetration (2)
- Xray and Burp linked Mining
- 浙大版《C语言程序设计实验与习题指导(第3版)》题目集
- MSF generate payload Encyclopedia
- Low income from doing we media? 90% of people make mistakes in these three points
猜你喜欢

线程的实现方式总结

关于交换a和b的值的四种方法

Intranet information collection of Intranet penetration (2)

《统计学》第八版贾俊平第七章知识点总结及课后习题答案

Statistics 8th Edition Jia Junping Chapter IX summary of knowledge points of classified data analysis and answers to exercises after class

网络基础之路由详解

Fundamentals of digital circuit (V) arithmetic operation circuit

Matplotlib绘图快速入门

Captcha killer verification code identification plug-in

Mysql的事务是什么?什么是脏读,什么是幻读?不可重复读?
随机推荐
【指针】查找最大的字符串
Proceedingjoinpoint API use
This article explains in detail how mockmvc is used in practical work
线程的实现方式总结
Sword finger offer 23 - print binary tree from top to bottom
Fundamentals of digital circuit (IV) data distributor, data selector and numerical comparator
JDBC read this article is enough
Pointeurs: maximum, minimum et moyenne
Numpy快速上手指南
《英特尔 oneAPI—打开异构新纪元》
【指针】求字符串的长度
Low income from doing we media? 90% of people make mistakes in these three points
Matplotlib绘图快速入门
. Net6: develop modern 3D industrial software based on WPF (2)
How does SQLite count the data that meets another condition under the data that has been classified once
数字电路基础(一)数制与码制
An unhandled exception occurred when C connected to SQL Server: system Argumentexception: "keyword not supported:" integrated
5分钟掌握机器学习鸢尾花逻辑回归分类
Hackmyvm target series (2) -warrior
Record an API interface SQL injection practice