A little challenge: "Reverse a string"

  • (6 Pages)
  • +
  • « First
  • 4
  • 5
  • 6

81 Replies - 21101 Views - Last Post: 27 February 2013 - 11:18 PM

#76 uzumakinaruto  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 29-September 12

Re: A little challenge: "Reverse a string"

Posted 28 November 2012 - 01:01 AM

but how do i reverse a string if it isnt a string? which means how do i avoid using pointers and arrays m confused
Was This Post Helpful? 0
  • +
  • -

#77 ishkabible  Icon User is offline

  • spelling expret
  • member icon





Reputation: 1526
  • View blog
  • Posts: 5,514
  • Joined: 03-August 09

Re: A little challenge: "Reverse a string"

Posted 28 November 2012 - 08:54 AM

most of the solutions that stayed within the confines of the challenge found an alternate representation for a string.
Was This Post Helpful? 0
  • +
  • -

#78 snypeNET  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 12
  • Joined: 06-October 12

Re: A little challenge: "Reverse a string"

Posted 12 January 2013 - 10:17 AM

I believe this works. I didn't know if string member functions are allowed. But here is my solution. It works!

Spoiler

Was This Post Helpful? 0
  • +
  • -

#79 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 869
  • View blog
  • Posts: 3,995
  • Joined: 09-June 09

Re: A little challenge: "Reverse a string"

Posted 12 January 2013 - 05:16 PM

Quote

I believe this works. I didn't know if string member functions are allowed. But here is my solution. It works!


The problem states that you are required NOT to use arrays, pointers, or C strings. Well you are using C++ strings so I think your not very creative solution passes.
Was This Post Helpful? 0
  • +
  • -

#80 snypeNET  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 12
  • Joined: 06-October 12

Re: A little challenge: "Reverse a string"

Posted 12 January 2013 - 05:34 PM

View Postjjl, on 12 January 2013 - 05:16 PM, said:

Quote

I believe this works. I didn't know if string member functions are allowed. But here is my solution. It works!


The problem states that you are required NOT to use arrays, pointers, or C strings. Well you are using C++ strings so I think your not very creative solution passes.


I don't think it's a question of creativity but does it solve the problem. And my solution solves the problem.
Was This Post Helpful? 0
  • +
  • -

#81 Limecore  Icon User is offline

  • New D.I.C Head

Reputation: 8
  • View blog
  • Posts: 40
  • Joined: 28-November 12

Re: A little challenge: "Reverse a string"

Posted 16 February 2013 - 12:08 AM

I haven't got the code yet, but not using the reverse function, I would use recursion, grabbing one letter, then calling itself, then printing the letter. Am not 100% sure how I would grab the letter yet, but im going to try
Was This Post Helpful? 0
  • +
  • -

#82 ashutosh23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 27-February 13

Re: A little challenge: "Reverse a string"

Posted 27 February 2013 - 11:18 PM

Spoiler

This post has been edited by Skydiver: 28 February 2013 - 06:19 AM
Reason for edit:: Fixed tags.

Was This Post Helpful? 0
  • +
  • -

  • (6 Pages)
  • +
  • « First
  • 4
  • 5
  • 6