www.pudn.com > 10to16.rar > try6.c


 
#include 
 
void strFront2Back(char result[]); 
 
void main() 
{ 
   char str[20]; 
   int i = 0; 
 
   for(i=0; i<20; i++) 
      str[i] = '\0'; 
 
   scanf("%s",str); 
   getchar(); 
 
   strFront2Back(str); 
   getch(); 
   return; 
} 
 
 
 
void strFront2Back(char result[]) 
{ 
   int t = 0; 
   int f = 0; 
   char ch = '\0'; 
 
   for(t=0; result[t]!='\0'; t++); 
 
   for(t--; t>=f ; t--,f++) 
   { 
      ch = result[f]; 
      result[f] = result[t]; 
      result[t] = ch; 
   } 
 
   return; 
}