当前位置:网站首页>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
边栏推荐
- “Hello IC World”
- 《统计学》第八版贾俊平第十四章指数知识点总结及课后习题答案
- Low income from doing we media? 90% of people make mistakes in these three points
- Statistics 8th Edition Jia Junping Chapter XIII Summary of knowledge points of time series analysis and prediction and answers to exercises after class
- Statistics, 8th Edition, Jia Junping, Chapter 11 summary of knowledge points of univariate linear regression and answers to exercises after class
- 《统计学》第八版贾俊平第三章课后习题及答案总结
- flask实现强制登陆
- 指针--剔除字符串中的所有数字
- 《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
- An unhandled exception occurred when C connected to SQL Server: system Argumentexception: "keyword not supported:" integrated
猜你喜欢
List and data frame of R language experiment III
网络基础之路由详解
数字电路基础(五)算术运算电路
Harmonyos application development -- address book management system telmanagesys based on listcontainer [phonebook][api v6]
Interview Essentials: what is the mysterious framework asking?
数据库多表链接的查询方式
Xray and Burp linked Mining
《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
Binary search tree concept
On the idea of vulnerability discovery
随机推荐
Proceedingjoinpoint API use
Only 40% of the articles are original? Here comes the modification method
函数:求1-1/2+1/3-1/4+1/5-1/6+1/7-…+1/n
【指针】数组逆序重新存放后并输出
This article explains in detail how mockmvc is used in practical work
安全面试之XSS(跨站脚本攻击)
《英特尔 oneAPI—打开异构新纪元》
函数:计算字符串中大写字母的个数
MySQL learning notes (stage 1)
1.支付系统
Fire! One day transferred to go engineer, not fire handstand sing Conquest (in serial)
servlet中 servlet context与 session与 request三个对象的常用方法和存放数据的作用域。
How to test whether an object is a proxy- How to test if an object is a Proxy?
5分钟掌握机器学习鸢尾花逻辑回归分类
Intel oneapi - opening a new era of heterogeneity
数字电路基础(四) 数据分配器、数据选择器和数值比较器
《统计学》第八版贾俊平第四章总结及课后习题答案
攻防世界MISC练习区(gif 掀桌子 ext3 )
msf生成payload大全
Detailed explanation of network foundation