Guess what the function's name is

Discussion in 'Web Design & Coding' started by X-Istence, Aug 15, 2007.

  1. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    All I can tell you about the below function is that it takes a char * a, as it's only argument, and manipulates the character array string in a certain way. Can you guess the name of the function, and or tell me what it does?

    Code:
            char * first;
            char * last;
            
            first = a;
            while ( *(a++) != 0 )
                    last = a;
            
            last--;
            while ( first != last ) {
                    if ( *first != *last ) {
                            *first ^= *last;
                            *last  ^= *first;
                            *first ^= *last;
                    }
                    
                    first++;
                    last--;
            }
     
  2. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    Come on people!
     
  3. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    ooh ooh, I know, I know :p


    but then we've already talked about this one.
     
  4. gonaads

    gonaads Beware the G-Man Political User Folding Team

    It turns on the doohickey which in turn activates the whatchamacallit. :nervous:
     
  5. Electronic Punk

    Electronic Punk Administrator Staff Member Political User Folding Team

    Messages:
    18,590
    Location:
    Copenhagen, Denmark
    It is called tim

    var tim.
     
  6. muzikool

    muzikool Act your wage. Political User

    Holy Grail reference?
     
  7. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    oh look its the guy from line 26 :p
     
  8. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    You guys suck!

    It is a function that takes a character array, and then reverses it so. So that:

    Hello
    becomes
    olleH
     
  9. gonaads

    gonaads Beware the G-Man Political User Folding Team

    Ohhhh, so then bob would still be... bob? :nervous: :p
     
  10. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    What would racecar be?? Draw a level award??
     
  11. gonaads

    gonaads Beware the G-Man Political User Folding Team

    Hah hah hah. :p
     
  12. Electronic Punk

    Electronic Punk Administrator Staff Member Political User Folding Team

    Messages:
    18,590
    Location:
    Copenhagen, Denmark
    sir not-appearing-in-this-function.
     
  13. Brad

    Brad Moderator Political User Folding Team

    Messages:
    2,280
    Location:
    Cary, NC
    :)ssenidren fo tol a si tahT