扭转一个字符串 [英] To reverse a string

查看:111
本文介绍了扭转一个字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以给我一个代码来反转超过

1MB的字符串。???

提前谢谢

could any one please give me a code to reverse a string of more than
1MB .???
Thanks in advance

推荐答案

" sudharsan" <苏********* @ gmail.com>在新闻中写道:1142873798.329339.167240

@ e56g2000cwe.googlegroups.com:
"sudharsan" <su*********@gmail.com> wrote in news:1142873798.329339.167240
@e56g2000cwe.googlegroups.com:
任何人都可以给我一个代码来反转一串以上的字符串
1MB。???
could any one please give me a code to reverse a string of more than
1MB .???




我能想到为什么字符串长度可能很重要的几个原因,但为什么对你来说这有什么关系吗?


strlen是否会找到困扰你的字符串的结尾?


你有没有尝试过琐碎的方式用它做任何

大小的字符串?


思南

-

A. Sinan Unur< 1u ** @ llenroc.ude.invalid>

(删除.invalid并反转每个组件的电子邮件地址)


comp。关于WWW的lang.perl.misc指南:
http ://mail.augustmail.com/~tadmc/cl...uidelines.html



I can think of several reasons why the length of the string might be
important, but why does it matter to you?

Is the strlen to find the end of the string bothering you?

Have you tried the trivial way of doing it in place for a string of any
size?

Sinan
--
A. Sinan Unur <1u**@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html


sudharsan opine d:
sudharsan opined:
任何人都可以给我一个代码来反转一串超过1MB的字符串。???
could any one please give me a code to reverse a string of more than
1MB .???




为什么你认为它不同于字符串少于

1MB?


-

BR,弗拉基米尔


我会在月球的阴暗面遇见你...

- Pink Floyd


sudharsan写道:
sudharsan wrote:
任何人都可以给我一个代码来反转一串超过1MB的字符串。 ?
提前致谢
could any one please give me a code to reverse a string of more than
1MB .???
Thanks in advance




许多C库实现提供了非标准的strrev()函数

它可以做你想要的。如果没有,那么你将不得不自己动手。

如果你做的话,字符串的大小不应该是一个考虑因素

学习编程或C.如果你能实现这个功能是一个可读和直接的方式,并在这里发布你的尝试,

常客可以帮助你进一步。这很容易做到。



Many C library implementations provide a non-standard strrev() function
which does what you want. If not, then you''ll have to roll your own.
The size of the string shouldn''t be a consideration if you''re doing
this to learn programming or C. If you can implement the function is a
readable and straightforward manner and post your attempt here, the
regulars can help you further. It''s quite easy to do.


这篇关于扭转一个字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆