please help me..
there anyone know how to reverse strings???
i really don't have idea for this..

please helps...

try this following code :

program Reverse_String;

 uses crt;

 const Elemen = 255;   {* Max character *}

 type S255     = string[Elemen];
      Stack = record
                   Input  : S255;
                   Tops : 0..Elemen
                 end;

 var  T       : Stack;  
      I       : integer;   
      StringInput : S255;     

  procedure AWALAN (var T : Stack);

  begin
    T.Tops := 0
  end;        

 
 procedure PUSH (var T : Stack; X : char);

 begin
   T.Tops := T.Tops + 1;
   T.Input[T.Tops] := X
 end;          {* PUSH *}

  function POP (var T : Stack) : char;

  begin
    POP := T.Input[T.Tops];
    T.Tops := T.Tops - 1
  end;         {* POP *}
 {*****************
  * Main program *
  *****************}
  begin
    clrscr;
    Awalan(T);
    writeln('Stack To reverse string');
    writeln('-------------------------------');
    writeln;

    {* String that it want to reverse*}
    write('Input any kind of Strings: ');
    readln(StringInput);

    clrscr;
    writeln('Original Strings:'); writeln(StringInput);

    writeln;writeln('Strings After Reverse:');

    {* push Input strings into Stack *}
    for I := 1 to length(StringInput) do
      PUSH (T, StringInput[I]);

    {* pop Stack Input until Input String reverse*}
    for I := 1 to length(StringInput) do
      write(POP(T));

    writeln
 end.
Comments
nice one...
what a wonderful code

wow...awesome..
thank you very much....
You are great person...:)

There is a faster way too:

Exchange:
a := a xor b;
b:= a xor b;
a:= a xor b;

And then start from the sides, and exchange every byte (or two, depends how long a character is) till the midle.

This question has already been answered. Start a new discussion instead.