In-place function

Discussion in 'C++' started by peter.mcclymont@gmail.com, Apr 3, 2006.

  1. Guest

    Hi There,

    Can you please help me write an in-place function in C++ for reversing
    a string.

    What is an in-place function?

    So what is a non-in-place function in that case to reverse a C++
    string?

    Urgent help needed.

    Thanks,

    Peter.
     
    , Apr 3, 2006
    #1
    1. Advertising

  2. Guest


    > What is an in-place function?

    Function that works without additional memory allocation.
    In fact, constant additional memory may be allocated, but the amount of
    additional memory should not be depended with the input.
    Non-in-place is just the opposite...

    The question sounds like homework, so the general idea will be to
    implement a "swap" function (with a temporary variable), only that the
    two arguments to swap are pointers to the start/end of the string.
     
    , Apr 3, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Bicking
    Replies:
    4
    Views:
    345
    Ian Bicking
    Apr 28, 2006
  2. Sori Schwimmer

    Editing a function in-memory and in-place

    Sori Schwimmer, Apr 27, 2006, in forum: Python
    Replies:
    0
    Views:
    302
    Sori Schwimmer
    Apr 27, 2006
  3. hurry
    Replies:
    8
    Views:
    397
    haroon
    Dec 29, 2005
  4. In-place function

    , Apr 3, 2006, in forum: C++
    Replies:
    7
    Views:
    1,513
    red floyd
    Apr 3, 2006
  5. Sergio Correia

    Best place for a function?

    Sergio Correia, Mar 7, 2007, in forum: Python
    Replies:
    4
    Views:
    271
    Sergio Correia
    Mar 7, 2007
Loading...

Share This Page