crack the code interview 1.2

吕晟睿
2023-12-01

Write code to reverse a C-Style String. (C-String means that “abcd” is represented as five characters, including the null character.)

void reverse(char * chr)
{
   char * end = chr;
   while (*end != '\0')
   {
        end ++;
   }
   end --;
   char * start = chr;
   while (*start != '\0')
   {
      *start ++ = *end--;
   }
}


 类似资料:

相关阅读

相关文章

相关问答